def route(conn_data)
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