Flowdock
method

route

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: SOAP::RPC::Router
route(conn_data) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/soap/rpc/router.rb, line 153
  def route(conn_data)
    # we cannot set request_default_encodingsyle before parsing the content.
    env = unmarshal(conn_data)
    if env.nil?
      raise ArgumentError.new("illegal SOAP marshal format")
    end
    op = lookup_operation(conn_data.soapaction, env.body)
    headerhandler = @headerhandler.dup
    @headerhandlerfactory.each do |f|
      headerhandler.add(f.create)
    end
    receive_headers(headerhandler, env.header)
    soap_response = default_encodingstyle = nil
    begin
      soap_response =
        op.call(env.body, @mapping_registry, @literal_mapping_registry,
          create_mapping_opt)
      default_encodingstyle = op.response_default_encodingstyle
    rescue Exception
      soap_response = fault($!)
      default_encodingstyle = nil
    end
    conn_data.is_fault = true if soap_response.is_a?(SOAPFault)
    header = call_headers(headerhandler)
    body = SOAPBody.new(soap_response)
    env = SOAPEnvelope.new(header, body)
    marshal(conn_data, env, default_encodingstyle)
  end
Register or log in to add new notes.