Class: WSDL::Resolver::Importer Private

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/wsdl/resolver/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.

Returns:

  • (Array<Class>)
[
  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

Instance Method Summary collapse

Methods included from Log

#logger

Constructor Details

#initialize(loader, 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.

Parameters:



47
48
49
50
51
52
53
54
55
56
# File 'lib/wsdl/resolver/importer.rb', line 47

def initialize(loader, documents, schemas, parse_options)
  @loader = loader
  @documents = documents
  @schemas = schemas
  @limits = parse_options.limits
  @strictness = parse_options.strictness
  @schema_count = 0
  @schema_import_errors = []
  @provenance = []
end

Instance Attribute Details

#provenanceArray<Hash{Symbol => Object}> (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.

Source provenance collected during import.

Each entry records the location, resolution status, content digest, and any error for a fetched document. This provides transparency into what was resolved and enables fingerprint computation.

Returns:

  • (Array<Hash{Symbol => Object}>)

    provenance entries with :location, :status (:resolved or :failed), :digest (SHA-256, or nil), and :error (String, or nil)



72
73
74
# File 'lib/wsdl/resolver/importer.rb', line 72

def provenance
  @provenance
end

#schema_import_errorsArray<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.

Returns:



61
62
63
# File 'lib/wsdl/resolver/importer.rb', line 61

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.

Parameters:

  • location (String)

    the location of the WSDL (URL or file path)



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/wsdl/resolver/importer.rb', line 78

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