Class: WSDL::Parser::Document Private
- Inherits:
-
Object
- Object
- WSDL::Parser::Document
- Defined in:
- lib/wsdl/parser/document.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.
Represents a single parsed WSDL document.
Parses a WSDL XML document and provides access to its various sections including messages, bindings, port types, and services. Also extracts XML Schema definitions embedded within the WSDL.
Instance Attribute Summary collapse
-
#bindings ⇒ Hash{QName => Binding}
readonly
private
The bindings defined in this document.
-
#messages ⇒ Hash{QName => MessageInfo}
readonly
private
The messages defined in this document.
-
#port_types ⇒ Hash{QName => PortType}
readonly
private
The port types defined in this document.
-
#services ⇒ Hash{String => Service}
readonly
private
The services defined in this document.
Instance Method Summary collapse
-
#imports ⇒ Array<String>
private
Returns the locations of imported WSDL documents.
-
#initialize(document, schemas) ⇒ Document
constructor
private
Creates a new Document by parsing a Nokogiri XML document.
-
#schemas(source_location = nil) ⇒ Array<Schema::Definition>
private
Returns the XML Schemas defined within this WSDL document.
-
#service_name ⇒ String
private
Returns the name of the WSDL definitions element.
-
#target_namespace ⇒ String
private
Returns the target namespace of this WSDL document.
Constructor Details
#initialize(document, schemas) ⇒ Document
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 Document by parsing a Nokogiri XML document.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/wsdl/parser/document.rb', line 18 def initialize(document, schemas) @document = document @schemas = schemas reject_unsupported_version! = {} @bindings = {} @port_types = {} @services = {} collect_sections( 'message' => { collection: , container: MessageInfo, qualified: true }, 'binding' => { collection: @bindings, container: Binding, qualified: true }, 'portType' => { collection: @port_types, container: PortType, qualified: true }, 'service' => { collection: @services, container: Service } ) end |
Instance Attribute Details
#bindings ⇒ Hash{QName => Binding} (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.
Returns the bindings defined in this document.
44 45 46 |
# File 'lib/wsdl/parser/document.rb', line 44 def bindings @bindings end |
#messages ⇒ Hash{QName => MessageInfo} (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.
Returns the messages defined in this document.
38 39 40 |
# File 'lib/wsdl/parser/document.rb', line 38 def end |
#port_types ⇒ Hash{QName => PortType} (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.
Returns the port types defined in this document.
41 42 43 |
# File 'lib/wsdl/parser/document.rb', line 41 def port_types @port_types end |
#services ⇒ Hash{String => Service} (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.
Returns the services defined in this document.
47 48 49 |
# File 'lib/wsdl/parser/document.rb', line 47 def services @services end |
Instance Method Details
#imports ⇒ Array<String>
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.
Returns the locations of imported WSDL documents.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/wsdl/parser/document.rb', line 77 def imports imports = [] @document.root.xpath('wsdl:import', 'wsdl' => NS::WSDL).each do |node| location = node['location'] imports << location if location end imports end |
#schemas(source_location = nil) ⇒ Array<Schema::Definition>
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.
Returns the XML Schemas defined within this WSDL document.
Schemas are typically found within the wsdl:types element.
70 71 72 |
# File 'lib/wsdl/parser/document.rb', line 70 def schemas(source_location = nil) schema_nodes.map { |node| Schema::Definition.new(node, @schemas, source_location) } end |
#service_name ⇒ String
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.
Returns the name of the WSDL definitions element.
52 53 54 |
# File 'lib/wsdl/parser/document.rb', line 52 def service_name @document.root['name'] end |
#target_namespace ⇒ String
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.
Returns the target namespace of this WSDL document.
59 60 61 |
# File 'lib/wsdl/parser/document.rb', line 59 def target_namespace @target_namespace ||= QName.document_namespace(@document.root) end |