How do I retrieve SOAP call and response in Ruby?
I'm using the SOAP gem in Ruby 1.8.7 and I'm looking for a functionality similar to PHP where, after a call is made, I can find the call and response X开发者_运维问答ML.
For example, in PHP's native SOAP library you would be able to call __getLastResponse()
, and __getLastRequest()
. Is there a similar functionality in Ruby?
My goal is to provide XML context to an error. In PHP you must turn on "trace" when constructing the object. In Ruby, I see you can set up a wiredump, but there does not seem to be a real "trace" option that digests the calls and responses naturally and provides those nice helper methods. Does that mean I'd have to wiredump to a particular file, on error go parse that file, and respond?
I use savon. https://github.com/rubiii/savon You can get the response as a hash, which you should be very happy about. Error handling is easy too, I suggest you check it out.
the Soap library offers a wiredump option to output the soap call/response to a buffer (stdout or FileIO/StringIO buffer).
精彩评论