In: |
soap/rpc/router.rb
|
Parent: | Object |
actor | [R] | |
allow_unqualified_element | [RW] | |
default_encodingstyle | [RW] | |
mapping_registry | [RW] |
# 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
# 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.
# 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…
# 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