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

Defined Under Namespace

Classes: Element, 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.



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

def initialize(parser)
  @parser = parser
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser.



16
17
18
# File 'lib/lolsoap/wsdl.rb', line 16

def parser
  @parser
end

Class Method Details

.parse(raw) ⇒ Object

Create a new instance by parsing a raw string of XML



12
13
14
# File 'lib/lolsoap/wsdl.rb', line 12

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

Instance Method Details

#endpointObject

The SOAP endpoint URL



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

def endpoint
  parser.endpoint
end

#inspectObject



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

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

#namespacesObject

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



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

def namespaces
  parser.namespaces
end

#operation(name) ⇒ Object

Get a single operation



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

def operation(name)
  load_operations[name]
end

#operationsObject

Hash of operations that are supports by the SOAP service



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

def operations
  load_operations.dup
end

#prefixesObject

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



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

def prefixes
  namespaces.invert
end

#type(name) ⇒ Object

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



38
39
40
# File 'lib/lolsoap/wsdl.rb', line 38

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

#type_namespacesObject

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



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

def type_namespaces
  Hash[parser.types.map { |k, t| [prefixes[t[:namespace]], t[:namespace]] }]
end

#typesObject

Hash of types declared by the service



33
34
35
# File 'lib/lolsoap/wsdl.rb', line 33

def types
  load_types.dup
end