# File soap/rpc/router.rb, line 342
def initialize(soapaction, name, param_def, opt)
@soapaction = soapaction
@name = name
@request_style = opt[:request_style]
@response_style = opt[:response_style]
@request_use = opt[:request_use]
@response_use = opt[:response_use]
check_style(@request_style)
check_style(@response_style)
check_use(@request_use)
check_use(@response_use)
if @response_style == :rpc
request_qname = opt[:request_qname] or raise
@rpc_method_factory =
RPC::SOAPMethodRequest.new(request_qname, param_def, @soapaction)
@rpc_response_qname = opt[:response_qname]
else
@doc_request_qnames = []
@doc_request_qualified = []
@doc_response_qnames = []
@doc_response_qualified = []
param_def.each do |inout, paramname, typeinfo, eleinfo|
klass, nsdef, namedef = typeinfo
qualified = eleinfo
case inout
when SOAPMethod::IN
@doc_request_qnames << XSD::QName.new(nsdef, namedef)
@doc_request_qualified << qualified
when SOAPMethod::OUT
@doc_response_qnames << XSD::QName.new(nsdef, namedef)
@doc_response_qualified << qualified
else
raise ArgumentError.new(
"illegal inout definition for document style: #{inout}")
end
end
end
end
# File soap/rpc/router.rb, line 389
def call(body, mapping_registry, literal_mapping_registry, opt)
if @request_style == :rpc
values = request_rpc(body, mapping_registry, literal_mapping_registry,
opt)
else
values = request_document(body, mapping_registry,
literal_mapping_registry, opt)
end
result = receiver.method(@name.intern).call(*values)
return result if result.is_a?(SOAPFault)
if @response_style == :rpc
response_rpc(result, mapping_registry, literal_mapping_registry, opt)
else
response_doc(result, mapping_registry, literal_mapping_registry, opt)
end
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.