From d37604f03ee9af7cf2d65ec2e1be986342a965c5 Mon Sep 17 00:00:00 2001 From: Kent Sibilev Date: Wed, 23 Aug 2006 09:34:46 +0000 Subject: Fixed XMLRPC multicall when one of the called methods returns a struct object. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4810 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/action_web_service/protocol/xmlrpc_protocol.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb') diff --git a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb index 64992e7754..a3abc6a24d 100644 --- a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +++ b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb @@ -58,6 +58,19 @@ module ActionWebService # :nodoc: Response.new(raw_response, 'text/xml', return_value) end + def encode_multicall_response(responses, protocol_options={}) + result = responses.map do |return_value, return_type| + if return_value && return_type + return_value = value_to_xmlrpc_wire_format(return_value, return_type) + return_value = [return_value] unless return_value.nil? + end + return_value = false if return_value.nil? + return_value + end + raw_response = XMLRPC::Marshal.dump_response(result) + Response.new(raw_response, 'text/xml', result) + end + def protocol_client(api, protocol_name, endpoint_uri, options={}) return nil unless protocol_name == :xmlrpc ActionWebService::Client::XmlRpc.new(api, endpoint_uri, options) -- cgit v1.2.3