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) ⇒ Object
Create a new instance by parsing a raw string of XML.
Instance Method Summary collapse
-
#initialize(parser) ⇒ 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) ⇒ WSDL
Returns a new instance of WSDL.
32 33 34 35 36 37 38 39 |
# File 'lib/lolsoap/wsdl.rb', line 32 def initialize(parser) @prefixes = generate_prefixes(parser) @namespaces = prefixes.invert @types = load_types(parser) @operations = load_operations(parser) @endpoint = parser.endpoint @soap_version = parser.soap_version end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
The SOAP endpoint URL
21 22 23 |
# File 'lib/lolsoap/wsdl.rb', line 21 def endpoint @endpoint end |
#namespaces ⇒ Object (readonly)
Hash of namespaces to generated prefixes
27 28 29 |
# File 'lib/lolsoap/wsdl.rb', line 27 def namespaces @namespaces end |
#prefixes ⇒ Object (readonly)
Hash of generated prefixes to namespaces
24 25 26 |
# File 'lib/lolsoap/wsdl.rb', line 24 def prefixes @prefixes end |
#soap_version ⇒ Object (readonly)
The version of SOAP detected.
30 31 32 |
# File 'lib/lolsoap/wsdl.rb', line 30 def soap_version @soap_version end |
Class Method Details
.parse(raw) ⇒ Object
Create a new instance by parsing a raw string of XML
16 17 18 |
# File 'lib/lolsoap/wsdl.rb', line 16 def self.parse(raw) new(WSDLParser.parse(raw)) end |
Instance Method Details
#inspect ⇒ Object
66 67 68 69 70 71 |
# File 'lib/lolsoap/wsdl.rb', line 66 def inspect "<#{self.class} " \ "namespaces=#{namespaces.inspect} " \ "operations=#{operations.inspect} " \ "types=#{types.inspect}>" end |
#operation(name) ⇒ Object
Get a single operation
57 58 59 |
# File 'lib/lolsoap/wsdl.rb', line 57 def operation(name) @operations.fetch(name) end |
#operations ⇒ Object
Hash of operations that are supported by the SOAP service
52 53 54 |
# File 'lib/lolsoap/wsdl.rb', line 52 def operations Hash[@operations.values.map { |o| [o.name, o] }] end |
#prefix(namespace) ⇒ Object
Get the prefix for a namespace
62 63 64 |
# File 'lib/lolsoap/wsdl.rb', line 62 def prefix(namespace) prefixes.fetch namespace end |
#type(namespace, name) ⇒ Object
Get a single type, or a NullType if the type doesn’t exist
47 48 49 |
# File 'lib/lolsoap/wsdl.rb', line 47 def type(namespace, name) @types.fetch([namespace, name]) { NullType.new } end |
#types ⇒ Object
Hash of types declared by the service
42 43 44 |
# File 'lib/lolsoap/wsdl.rb', line 42 def types Hash[@types.values.map { |t| [t.name, t] }] end |