Forum: Ruby on Rails AWS, SOAP, and Exceptions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3bfee72f5cc0f1a1336d36a28394c75c?d=identicon&s=25 James (Guest)
on 2006-01-07 16:17
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:in
`cast'
     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:in
`cast_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:in
`web_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?
3bfee72f5cc0f1a1336d36a28394c75c?d=identicon&s=25 James (Guest)
on 2006-01-10 02:14
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?
This topic is locked and can not be replied to.