AWS, SOAP, and Exceptions


#1

Can someone shed some light on how to convert an Exception to a
SOAPFault on Rails 1.0/AWS 1.0? I’ve been digging through the source
code and see that in soap_protocol.rb there is a method called
encode_response() that seems to perform the translation of an Exception
to a SOAPFault. However, if I use the following code block within my Web
Service controller:

def get_calendar(calId)
begin
return Calendar.find(calId)
rescue Exception => e
return e
end
end

I see the following error, prior to the call to encode_reponse():

 "Don't know how to cast ActiveRecord::RecordNotFound to Calendar"

 c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/casting.rb:119:in 

cast_to_structured_type' c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/casting.rb:55:incast’
c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/casting.rb:38:in
cast_returns' c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/casting.rb:25:incast_returns’
c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/api.rb:189:in
cast_returns' c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/dispatcher/abstract.rb:182:inweb_service_create_response’
c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/dispatcher/abstract.rb:59:in
`web_service_invoke’

Is this not supported yet, or am I missing something?


#2

James wrote:

Can someone shed some light on how to convert an Exception to a
SOAPFault on Rails 1.0/AWS 1.0? I’ve been digging through the source…

Reposting. Can anyone confirm that Faults aren’t supported by RoR in
v1.0, or if I should be taking a different approach to the problem?