Class: LolSoap::WSDL
- Inherits:
-
Object
- Object
- LolSoap::WSDL
- Defined in:
- lib/lolsoap/wsdl.rb,
lib/lolsoap/wsdl/type.rb,
lib/lolsoap/wsdl/element.rb,
lib/lolsoap/wsdl/null_type.rb,
lib/lolsoap/wsdl/operation.rb,
lib/lolsoap/wsdl/null_element.rb,
lib/lolsoap/wsdl/operation_io.rb,
lib/lolsoap/wsdl/operation_io_part.rb,
lib/lolsoap/wsdl/named_type_reference.rb,
lib/lolsoap/wsdl/immediate_type_reference.rb
Defined Under Namespace
Classes: Element, ImmediateTypeReference, NamedTypeReference, NullElement, NullType, Operation, OperationIO, OperationIOPart, Type
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
The SOAP endpoint URL.
-
#namespaces ⇒ Object
readonly
Hash of namespaces to generated prefixes.
-
#prefixes ⇒ Object
readonly
Hash of generated prefixes to namespaces.
-
#soap_version ⇒ Object
readonly
The version of SOAP detected.
Class Method Summary collapse
-
.parse(raw, options = {}) ⇒ Object
Create a new instance by parsing a raw string of XML.
Instance Method Summary collapse
-
#abstract_type(namespace, name) ⇒ Object
Get a single abstract type, or a NullType if the type doesn’t exist.
-
#abstract_types ⇒ Object
Hash of abstract types declared by the service.
-
#initialize(parser, options = {}) ⇒ WSDL
constructor
A new instance of WSDL.
- #inspect ⇒ Object
-
#operation(name) ⇒ Object
Get a single operation.
-
#operations ⇒ Object
Hash of operations that are supported by the SOAP service.
-
#prefix(namespace) ⇒ Object
Get the prefix for a namespace.
-
#type(namespace, name) ⇒ Object
Get a single type, or a NullType if the type doesn’t exist.
-
#types ⇒ Object
Hash of types declared by the service.
Constructor Details
#initialize(parser, options = {}) ⇒ WSDL
Returns a new instance of WSDL.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/lolsoap/wsdl.rb', line 34 def initialize(parser, ={}) @prefixes = generate_prefixes(parser) @namespaces = prefixes.invert @abstract_types = load_types(parser.abstract_types) @types = load_types(parser.types) @operations = load_operations(parser) @endpoint = parser.endpoint @soap_version = parser.soap_version @allow_abstract_types = [:allow_abstract_types] end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
The SOAP endpoint URL
23 24 25 |
# File 'lib/lolsoap/wsdl.rb', line 23 def endpoint @endpoint end |
#namespaces ⇒ Object (readonly)
Hash of namespaces to generated prefixes
29 30 31 |
# File 'lib/lolsoap/wsdl.rb', line 29 def namespaces @namespaces end |
#prefixes ⇒ Object (readonly)
Hash of generated prefixes to namespaces
26 27 28 |
# File 'lib/lolsoap/wsdl.rb', line 26 def prefixes @prefixes end |
#soap_version ⇒ Object (readonly)
The version of SOAP detected.
32 33 34 |
# File 'lib/lolsoap/wsdl.rb', line 32 def soap_version @soap_version end |
Class Method Details
.parse(raw, options = {}) ⇒ Object
Create a new instance by parsing a raw string of XML
18 19 20 |
# File 'lib/lolsoap/wsdl.rb', line 18 def self.parse(raw, ={}) new(WSDLParser.parse(raw), ) end |
Instance Method Details
#abstract_type(namespace, name) ⇒ Object
Get a single abstract type, or a NullType if the type doesn’t exist
65 66 67 |
# File 'lib/lolsoap/wsdl.rb', line 65 def abstract_type(namespace, name) @abstract_types.fetch([namespace, name]) { NullType.new } end |
#abstract_types ⇒ Object
Hash of abstract types declared by the service
51 52 53 |
# File 'lib/lolsoap/wsdl.rb', line 51 def abstract_types Hash[@abstract_types.values.map { |t| [t.name, t] }] end |
#inspect ⇒ Object
84 85 86 87 88 89 |
# File 'lib/lolsoap/wsdl.rb', line 84 def inspect "<#{self.class} " \ "namespaces=#{namespaces.inspect} " \ "operations=#{operations.inspect} " \ "types=#{types.inspect}>" end |
#operation(name) ⇒ Object
Get a single operation
75 76 77 |
# File 'lib/lolsoap/wsdl.rb', line 75 def operation(name) @operations.fetch(name) end |
#operations ⇒ Object
Hash of operations that are supported by the SOAP service
70 71 72 |
# File 'lib/lolsoap/wsdl.rb', line 70 def operations Hash[@operations.values.map { |o| [o.name, o] }] end |
#prefix(namespace) ⇒ Object
Get the prefix for a namespace
80 81 82 |
# File 'lib/lolsoap/wsdl.rb', line 80 def prefix(namespace) prefixes.fetch namespace end |
#type(namespace, name) ⇒ Object
Get a single type, or a NullType if the type doesn’t exist
56 57 58 59 60 61 62 |
# File 'lib/lolsoap/wsdl.rb', line 56 def type(namespace, name) if @allow_abstract_types @types.fetch([namespace, name]) { abstract_type(namespace, name) } else @types.fetch([namespace, name]) { NullType.new } end end |
#types ⇒ Object
Hash of types declared by the service
46 47 48 |
# File 'lib/lolsoap/wsdl.rb', line 46 def types Hash[@types.values.map { |t| [t.name, t] }] end |