Class: Sekken::WSDL::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/sekken/wsdl/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document, schemas) ⇒ Document

Returns a new instance of Document.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sekken/wsdl/document.rb', line 11

def initialize(document, schemas)
  @document = document
  @schemas = schemas

  @messages, @bindings, @port_types, @services = {}, {}, {}, {}

  collect_sections(
    'message'  => { :collection => @messages,   :container => Message  },
    'binding'  => { :collection => @bindings,   :container => Binding  },
    'portType' => { :collection => @port_types, :container => PortType },
    'service'  => { :collection => @services,   :container => Service  }
  )
end

Instance Attribute Details

#bindingsObject (readonly)

Returns the value of attribute bindings.



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

def bindings
  @bindings
end

#messagesObject (readonly)

Returns the value of attribute messages.



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

def messages
  @messages
end

#port_typesObject (readonly)

Returns the value of attribute port_types.



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

def port_types
  @port_types
end

#servicesObject (readonly)

Returns the value of attribute services.



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

def services
  @services
end

Instance Method Details

#importsObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/sekken/wsdl/document.rb', line 39

def imports
  imports = []

  @document.root.xpath('wsdl:import', 'wsdl' => Sekken::NS_WSDL).each do |node|
    location = node['location']
    imports << location if location
  end

  imports
end

#schemasObject



35
36
37
# File 'lib/sekken/wsdl/document.rb', line 35

def schemas
  schema_nodes.map { |node| XS::Schema.new(node, @schemas) }
end

#service_nameObject



27
28
29
# File 'lib/sekken/wsdl/document.rb', line 27

def service_name
  @document.root['name']
end

#target_namespaceObject



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

def target_namespace
  @document.root['targetNamespace']
end