Yer Mom has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use SOAP::Lite to get information from a remote server. Unfortunately, it only ever seems to reply '405 Method Not Allowed', and tech support insist they can't help me without a dump of the XML that I'm sending to their server. None of them speak Perl (heathens!)

How do I get SOAP::Lite to dump the XML it's trying to send? I've tried use SOAP::Lite +trace => [qw(transport)], but the 405 generates a runtime error and I can't output the trace data. I don't know where the web server is stuffing STDERR, but it's not anywhere I can see it. And I don't have access to the error log :(

Redirecting STDERR seems to be the way forward, but I don't know where on the server I can write it *to* - the server process doesn't have write permission to most places (sensible move, but not helpful here!)

Maybe I could capture STDERR to a string variable, and have that variable automatically dumped when Perl die()s? I have a vague feeling that should be possible, but my Google-fu is weak on all of this...

Thanks!

Replies are listed 'Best First'.
Re: Dumping the XML request with SOAP::Lite
by marto (Cardinal) on Oct 26, 2005 at 10:25 UTC
Re: Dumping the XML request with SOAP::Lite
by Corion (Patriarch) on Oct 26, 2005 at 10:57 UTC

    If you have any network sniffer available, you can use that to dump the bytes as they go over the wire. This is of course a really ugly way of going about it, but it has the convenient advantage of working for every kind of HTTP-based format, be it HTML or XML. Coincidentially, I've written Sniffer::HTTP, which sniffs a HTTP connection and gives you HTTP::Request and HTTP::Response objects as it encounters them in the stream. But the easier way for you would likely be to use ethereal, which can save the transfer to a file and analyze it without requiring you to write a program. Also, it is much more tested out than my module.