views:

271

answers:

3

Hi,

How can see the wiredump of a soap using the 'handsoap' library?

I use the on_before_dispatch hook, and right now I am looking at the SoapService variables to see where such a request might be stored.

Hmm.. I should also check out invoke to see which var. is using..

Do you have a quick solution? :D Thanks

A: 

I used the hook

def on_before_dispatch
    puts @@document
  end

and document holds the doc variable.

@@document = nil

  def on_create_document(doc)
    @@document = doc
    ...
A toolkit for using soap web services in Ruby should contain:- wireshark- soapUI- handsoap
A: 

On a more abstract (none ruby specific) note, try wireshark. Been using it for wiredumps for all kinds of apps for years.

cwninja
+1  A: 

You can dump http-activity by setting the class variable $logger, as in:

Example::FooService.logger = $stdout

This will dump out the http-request and response, nicely formatted. Note that this is not 100% what goes over the wire, since the underlying http-client implementation may add some headers etc. For most uses, ths doesn't matter, but if you're tracing down a bug, you might want to employ wireshark.

troelskn