1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

special-case non-existent target method handling for 'system.multicall' calls when the

method does not exist, to conform to the RFC and return the error inline in the multicall response.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Leon Breedt 2005-08-16 05:54:12 +00:00
parent 9d79880e81
commit fbba128f73
2 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -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