aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/abstract.rb10
-rw-r--r--actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb8
2 files changed, 15 insertions, 3 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
index 7e43892b24..cf3af538ab 100644
--- a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
+++ b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
@@ -62,6 +62,10 @@ module ActionWebService # :nodoc:
def xmlrpc_multicall_invoke(invocations)
responses = []
invocations.each do |invocation|
+ if invocation.is_a?(Hash)
+ responses << invocation
+ next
+ end
begin
case web_service_dispatching_mode
when :direct
@@ -120,7 +124,11 @@ module ActionWebService # :nodoc:
multicall_request = request.dup
multicall_request.method_name = method_name
multicall_request.method_params = params
- web_service_invocation(multicall_request, level + 1)
+ begin
+ web_service_invocation(multicall_request, level + 1)
+ rescue Exception => e
+ {'faultCode' => 4, 'faultMessage' => e.message}
+ end
end
end
end
diff --git a/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb b/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
index 8309b0e16d..95c9333954 100644
--- a/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
+++ b/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
@@ -26,7 +26,9 @@ class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
{'methodName' => 'mt.bool'},
{'methodName' => 'blogger.str', 'params' => ['2000']},
{'methodName' => 'mt.alwaysFail'},
- {'methodName' => 'blogger.alwaysFail'}
+ {'methodName' => 'blogger.alwaysFail'},
+ {'methodName' => 'mt.blah'},
+ {'methodName' => 'blah.blah'}
])
assert_equal [
[["mtCat1", "mtCat2"]],
@@ -34,7 +36,9 @@ class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
[true],
["2500"],
{"faultCode" => 3, "faultString" => "MT AlwaysFail"},
- {"faultCode" => 3, "faultString" => "Blogger AlwaysFail"}
+ {"faultCode" => 3, "faultString" => "Blogger AlwaysFail"},
+ {"faultCode" => 4, "faultMessage" => "no such method 'blah' on API DispatcherTest::MTAPI"},
+ {"faultCode" => 4, "faultMessage" => "no such web service 'blah'"}
], response
end