bwizzy bwizzy - 1 year ago 82
Ruby Question

How to do a wiredump of XMLRPC::Client in ruby?

I'm working on some code using XML RPC in ruby and need to see some debug info, how do you do that?

Answer Source

Reading the source of the package, XMLRPC::Client uses Net::HTTP in turn as its transport.

So I think you should be able to monkey-patch a method into the XMLRPC::Client accordingly:

require 'pp'

# the magic happens here
class XMLRPC::Client
  def set_debug

server = XMLRPC::Client.new2("")
result ="", "Copenhagen.rb", "")
pp result

(sample for XMLRPC snarfed from here).