Class: Sekken::WSDL
- Inherits:
-
Object
- Object
- Sekken::WSDL
- Defined in:
- lib/sekken/wsdl.rb,
lib/sekken/wsdl/port.rb,
lib/sekken/wsdl/binding.rb,
lib/sekken/wsdl/message.rb,
lib/sekken/wsdl/service.rb,
lib/sekken/wsdl/document.rb,
lib/sekken/wsdl/operation.rb,
lib/sekken/wsdl/port_type.rb,
lib/sekken/wsdl/input_output.rb,
lib/sekken/wsdl/binding_operation.rb,
lib/sekken/wsdl/document_collection.rb,
lib/sekken/wsdl/port_type_operation.rb
Defined Under Namespace
Classes: Binding, BindingOperation, Document, DocumentCollection, Input, Message, Operation, Output, Port, PortType, PortTypeOperation, Service
Instance Attribute Summary collapse
-
#documents ⇒ Object
readonly
Public: Returns the DocumentCollection.
-
#schemas ⇒ Object
readonly
Public: Returns the SchemaCollection.
Instance Method Summary collapse
-
#initialize(wsdl, http) ⇒ WSDL
constructor
A new instance of WSDL.
-
#operation(service_name, port_name, operation_name) ⇒ Object
Public: Returns an Operation by service, port and operation name.
-
#operations(service_name, port_name) ⇒ Object
Public: Returns an Hash of operation names to Operations by service and port name.
-
#service_name ⇒ Object
Public: Returns the name of the service.
-
#services ⇒ Object
Public: Returns a Hash of services and ports defined by the WSDL.
Constructor Details
#initialize(wsdl, http) ⇒ WSDL
Returns a new instance of WSDL.
10 11 12 13 14 15 16 17 |
# File 'lib/sekken/wsdl.rb', line 10 def initialize(wsdl, http) @documents = WSDL::DocumentCollection.new @schemas = XS::SchemaCollection.new resolver = Resolver.new(http) importer = Importer.new(resolver, @documents, @schemas) importer.import(wsdl) end |
Instance Attribute Details
#documents ⇒ Object (readonly)
Public: Returns the DocumentCollection.
20 21 22 |
# File 'lib/sekken/wsdl.rb', line 20 def documents @documents end |
#schemas ⇒ Object (readonly)
Public: Returns the SchemaCollection.
23 24 25 |
# File 'lib/sekken/wsdl.rb', line 23 def schemas @schemas end |
Instance Method Details
#operation(service_name, port_name, operation_name) ⇒ Object
Public: Returns an Operation by service, port and operation name.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/sekken/wsdl.rb', line 46 def operation(service_name, port_name, operation_name) verify_operation_exists! service_name, port_name, operation_name port = @documents.service_port(service_name, port_name) endpoint = port.location binding = port.fetch_binding(@documents) binding_operation = binding.operations.fetch(operation_name) port_type = binding.fetch_port_type(@documents) port_type_operation = port_type.operations.fetch(operation_name) Operation.new(operation_name, endpoint, binding_operation, port_type_operation, self) end |
#operations(service_name, port_name) ⇒ Object
Public: Returns an Hash of operation names to Operations by service and port name.
36 37 38 39 40 41 42 43 |
# File 'lib/sekken/wsdl.rb', line 36 def operations(service_name, port_name) verify_service_and_port_exist! service_name, port_name port = @documents.service_port(service_name, port_name) binding = port.fetch_binding(@documents) binding.operations.keys end |
#service_name ⇒ Object
Public: Returns the name of the service.
26 27 28 |
# File 'lib/sekken/wsdl.rb', line 26 def service_name @documents.service_name end |
#services ⇒ Object
Public: Returns a Hash of services and ports defined by the WSDL.
31 32 33 |
# File 'lib/sekken/wsdl.rb', line 31 def services @documents.services.values.inject({}) { |memo, service| memo.merge service.to_hash } end |