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 36 |
# File 'lib/wsdl/parser/document.rb', line 18 def initialize(document, schemas) @document = document @schemas = schemas reject_empty_document! reject_unsupported_version! @messages = {} @bindings = {} @port_types = {} @services = {} collect_sections( 'message' => { collection: @messages, 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.
45 46 47 |
# File 'lib/wsdl/parser/document.rb', line 45 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.
39 40 41 |
# File 'lib/wsdl/parser/document.rb', line 39 def @messages 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.
42 43 44 |
# File 'lib/wsdl/parser/document.rb', line 42 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.
48 49 50 |
# File 'lib/wsdl/parser/document.rb', line 48 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.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/wsdl/parser/document.rb', line 78 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.
71 72 73 |
# File 'lib/wsdl/parser/document.rb', line 71 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.
53 54 55 |
# File 'lib/wsdl/parser/document.rb', line 53 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.
60 61 62 |
# File 'lib/wsdl/parser/document.rb', line 60 def target_namespace @target_namespace ||= QName.document_namespace(@document.root) end |