Class: WSDL::Parser::Importer Private
- Inherits:
-
Object
- Object
- WSDL::Parser::Importer
- Includes:
- Log
- Defined in:
- lib/wsdl/parser/importer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Imports WSDL documents and their referenced schemas.
Handles recursive imports, including WSDL imports and XSD imports/includes. Supports relative paths resolved against the parent document's location.
Constant Summary collapse
- RECOVERABLE_SCHEMA_IMPORT_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Exceptions that are treated as recoverable schema import failures.
These are wrapped into SchemaImportError and either raised or collected depending on strict schema mode.
[ SystemCallError, IOError, EOFError, SocketError, URI::InvalidURIError, Timeout::Error ].tap { |errors| errors << OpenSSL::SSL::SSLError if defined?(OpenSSL::SSL::SSLError) errors << Net::OpenTimeout if defined?(Net::OpenTimeout) errors << Net::ReadTimeout if defined?(Net::ReadTimeout) }.freeze
Instance Attribute Summary collapse
-
#schema_import_errors ⇒ Array<SchemaImportError>
readonly
private
Recoverable schema import errors captured during import.
Instance Method Summary collapse
-
#import(location) ⇒ void
private
Imports a WSDL document and all its dependencies.
-
#initialize(resolver, documents, schemas, parse_options) ⇒ Importer
constructor
private
Creates a new Importer instance.
Methods included from Log
Constructor Details
#initialize(resolver, documents, schemas, parse_options) ⇒ Importer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new Importer instance.
45 46 47 48 49 50 51 52 53 |
# File 'lib/wsdl/parser/importer.rb', line 45 def initialize(resolver, documents, schemas, ) @resolver = resolver @documents = documents @schemas = schemas @limits = .limits @strict_schema = .strict_schema @schema_count = 0 @schema_import_errors = [] end |
Instance Attribute Details
#schema_import_errors ⇒ Array<SchemaImportError> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Recoverable schema import errors captured during import.
58 59 60 |
# File 'lib/wsdl/parser/importer.rb', line 58 def schema_import_errors @schema_import_errors end |
Instance Method Details
#import(location) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Imports a WSDL document and all its dependencies.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/wsdl/parser/importer.rb', line 64 def import(location) @import_locations = [] logger.info("Resolving WSDL document #{location.inspect}.") import_document(location, base: nil) do |document, resolved_location| @documents << document schemas = document.schemas(resolved_location) track_schema_count(schemas.size) @schemas.push(schemas) end # Resolve XML schema imports and includes import_schemas @documents.seal! end |