I''m really new to RoR and my first task is to write SOAP web service. The problem is that I don''t understand how to send custom SOAPFault messages in case of the errors. For example, I have FindCustomerById API signature: api_method :find_customer_by_id, :expects => [{:customer_id => :int}], :returns => [Customer] And controller: def find_customer_by_id(customer_id) Customer.find(customer_id) end The requirement from the vendor is that if such customer does not exist I have to send back to client SOAPFault message with faultcode "error", faultstring = "no such customer" and such detail: <error> <param id="errorCode" label="Error code">incorrect_request</param> <param id="errorDescr" label="Error description">Custome with such customer_id does not exists</param> </error> I''m cant figure out how to construct such SOAPFault message and send it back. Please help me, with some example code if possible. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m really new to RoR and my first task is to write SOAP web service. The problem is that I don''t understand how to send custom SOAPFault messages in case of the errors. For example, I have FindCustomerById API signature: api_method :find_customer_by_id, :expects => [{:customer_id => :int}], :returns => [Customer] And controller: def find_customer_by_id(customer_id) Customer.find(customer_id) end The requirement from the vendor is that if such customer does not exist I send back to client SOAPFault message with faultcode "error", faultstring = "no such customer" and such detail: <error> <param id="errorCode" label="Error code">incorrect_request</param> <param id="errorDescr" label="Error description">Custome with such customer_id does not exists</param> </error> I cant figure out how to construct such SOAPFault message and send it back. Please help me, with some example code if possible. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, I am actually having the same problem. Have you figured out how to construct a SOAPFault object using RoR? If so, would it possible to give me some clue? Thanks, Yan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---