class Sekken

Constants

Error

Public: Base error class.

NS_SOAP_1_1
NS_SOAP_1_2
NS_WSDL
NS_XSD
UnsupportedStyleError

Public: Raised if the style of an operation is not supported.

VERSION

Attributes

wsdl[R]

Public: Returns the Wasabi instance.

Public Class Methods

http_adapter() click to toggle source

Public: Returns the HTTP adapter to use.

# File lib/sekken.rb, line 18
def self.http_adapter
  @http_adapter ||= HTTPClient
end
http_adapter=(adapter) click to toggle source

Public: Sets the HTTP adapter to use.

# File lib/sekken.rb, line 23
def self.http_adapter=(adapter)
  @http_adapter = adapter
end
new(wsdl, http = nil) click to toggle source
# File lib/sekken.rb, line 27
def initialize(wsdl, http = nil)
  @http = http || new_http_client
  @wsdl = WSDL.new(wsdl, @http)
end

Public Instance Methods

http() click to toggle source

Public: Returns the HTTP adapter‘s client instance.

# File lib/sekken.rb, line 36
def http
  @http.client
end
operation(service_name, port_name, operation_name) click to toggle source

Public: Returns an Operation by service, port and operation name.

# File lib/sekken.rb, line 51
def operation(service_name, port_name, operation_name)
  operation = @wsdl.operation(service_name.to_s, port_name.to_s, operation_name.to_s)
  verify_operation_style! operation

  Operation.new(operation, @wsdl, @http)
end
operations(service_name, port_name) click to toggle source

Public: Returns an Array of operations for a service and port.

# File lib/sekken.rb, line 46
def operations(service_name, port_name)
  @wsdl.operations(service_name.to_s, port_name.to_s)
end
services() click to toggle source

Public: Returns the services and ports defined by the WSDL.

# File lib/sekken.rb, line 41
def services
  @wsdl.services
end

Private Instance Methods

new_http_client() click to toggle source

Private: Returns a new instance of the HTTP adapter to use.

# File lib/sekken.rb, line 61
def new_http_client
  self.class.http_adapter.new
end
verify_operation_style!(operation) click to toggle source

Private: Raises if the operation style is not supported.

# File lib/sekken.rb, line 66
def verify_operation_style!(operation)
  if operation.input_style == 'rpc/encoded'
    raise UnsupportedStyleError,
          "#{operation.name.inspect} is an #{operation.input_style.inspect} style operation.\n" \
          "Currently this style is not supported."
  end
end