Class: LolSoap::WSDL

Inherits:
Object
  • Object
show all
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/named_type_reference.rb,
lib/lolsoap/wsdl/immediate_type_reference.rb

Defined Under Namespace

Classes: Element, ImmediateTypeReference, NamedTypeReference, NullElement, NullType, Operation, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ WSDL

Returns a new instance of WSDL.



33
34
35
36
37
38
39
40
41
# File 'lib/lolsoap/wsdl.rb', line 33

def initialize(parser)
  @types           = load_types(parser)
  @operations      = load_operations(parser)
  @endpoint        = parser.endpoint
  @namespaces      = parser.namespaces
  @type_namespaces = load_type_namespaces(parser)
  @prefixes        = parser.prefixes
  @soap_version    = parser.soap_version
end

Instance Attribute Details

#endpointObject (readonly)

The SOAP endpoint URL



19
20
21
# File 'lib/lolsoap/wsdl.rb', line 19

def endpoint
  @endpoint
end

#namespacesObject (readonly)

Hash of namespaces used in the WSDL document (keys are prefixes)



22
23
24
# File 'lib/lolsoap/wsdl.rb', line 22

def namespaces
  @namespaces
end

#prefixesObject (readonly)

Hash of namespace prefixes used in the WSDL document (keys are namespace URIs)



28
29
30
# File 'lib/lolsoap/wsdl.rb', line 28

def prefixes
  @prefixes
end

#soap_versionObject (readonly)

The version of SOAP detected.



31
32
33
# File 'lib/lolsoap/wsdl.rb', line 31

def soap_version
  @soap_version
end

#type_namespacesObject (readonly)

Namespaces used by the types (a subset of #namespaces)



25
26
27
# File 'lib/lolsoap/wsdl.rb', line 25

def type_namespaces
  @type_namespaces
end

Class Method Details

.parse(raw) ⇒ Object

Create a new instance by parsing a raw string of XML



14
15
16
# File 'lib/lolsoap/wsdl.rb', line 14

def self.parse(raw)
  new(WSDLParser.parse(raw))
end

Instance Method Details

#inspectObject



63
64
65
66
67
68
# File 'lib/lolsoap/wsdl.rb', line 63

def inspect
  "<#{self.class} " \
  "namespaces=#{@namespaces.inspect} " \
  "operations=#{@operations.keys.inspect} " \
  "types=#{@types.keys.inspect}>"
end

#operation(name) ⇒ Object

Get a single operation



59
60
61
# File 'lib/lolsoap/wsdl.rb', line 59

def operation(name)
  @operations.fetch(name)
end

#operationsObject

Hash of operations that are supports by the SOAP service



54
55
56
# File 'lib/lolsoap/wsdl.rb', line 54

def operations
  @operations.dup
end

#type(name) ⇒ Object

Get a single type, or a NullType if the type doesn’t exist



49
50
51
# File 'lib/lolsoap/wsdl.rb', line 49

def type(name)
  @types.fetch(name) { NullType.new }
end

#typesObject

Hash of types declared by the service



44
45
46
# File 'lib/lolsoap/wsdl.rb', line 44

def types
  @types.dup
end