SOAP::RPC::Router (Class)

In: soap/rpc/router.rb
Parent: Object

Attributes

actor  [R] 
allow_unqualified_element  [RW] 
default_encodingstyle  [RW] 
mapping_registry  [RW] 

Included Modules

Public Class methods

[Source]

# File soap/rpc/router.rb, line 28
  def initialize(actor)
    @actor = actor
    @receiver = {}
    @method_name = {}
    @method = {}
    @allow_unqualified_element = false
    @default_encodingstyle = nil
    @mapping_registry = nil
  end

Public Instance methods

[Source]

# File soap/rpc/router.rb, line 45
  def add_header_handler
    raise NotImplementedError.new
  end

[Source]

# File soap/rpc/router.rb, line 38
  def add_method(receiver, qname, soapaction, name, param_def)
    fqname = fqname(qname)
    @receiver[fqname] = receiver
    @method_name[fqname] = name
    @method[fqname] = RPC::SOAPMethodRequest.new(qname, param_def, soapaction)
  end

Create fault response string.

[Source]

# File soap/rpc/router.rb, line 75
  def create_fault_response(e, charset = nil)
    header = SOAPHeader.new
    soap_response = fault(e)
    body = SOAPBody.new(soap_response)
    opt = options
    opt[:charset] = charset
    Processor.marshal(header, body, opt)
  end

Routing…

[Source]

# File soap/rpc/router.rb, line 50
  def route(soap_string, charset = nil)
    opt = options
    opt[:charset] = charset
    is_fault = false
    begin
      header, body = Processor.unmarshal(soap_string, opt)
      # So far, header is omitted...

      soap_request = body.request
      unless soap_request.is_a?(SOAPStruct)
        raise RPCRoutingError.new("Not an RPC style.")
      end
      soap_response = dispatch(soap_request)
    rescue Exception
      soap_response = fault($!)
      is_fault = true
    end

    header = SOAPHeader.new
    body = SOAPBody.new(soap_response)
    response_string = Processor.marshal(header, body, opt)

    return response_string, is_fault
  end

[Validate]