How to get SOAP call and response in Ruby?

I use the SOAP pearl in Ruby 1.8.7, and I am looking for functionality similar to PHP, where after the call is completed I can find the XML request and response.

For example, in your own PHP SOAP library, you can call __getLastResponse()and __getLastRequest(). Is there any similar functionality in Ruby?

My goal is to provide an XML context error. In PHP, you must enable "tracing" when building the object. In Ruby, I see that you can configure wiredump, but there seems to be no real “trace” option that naturally digests calls and answers and provides these nice helper methods. Does this mean that I will have to connect to a specific file, mistakenly run this file and respond?

+3
source share
2 answers

I use Savon. https://github.com/rubiii/savon You can get the answer as a hash that you really like. Error handling is also very simple, I suggest you check this out.

0
source

The Soap library offers the wiredump parameter to output the call / answer to the soap into the buffer (stdout or the FileIO / StringIO buffer).

0
source

All Articles