Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl: Getting complete request from SOAP::WSDL object

I'm working with SOAP::WSDL and another company's custom WSDL file. Every time they make a change for me and I recreate my modules, something breaks. Finding the problem is rather tedious because I don't find a proper way to access the actual request that is sent to the SOAP server.

The only way to get to the request so far has been to use tcpdump in conjunction with wireshark to extract the request and result. That works, but since I don't have root privileges on the dev machine I have to get an admin over every time I want to do that. I feel there must be another way to get to the HTTP::Request object inside the SOAP::WSDL thing. But if the server returns a fault, I don't even have a response object, but rather a SOAP::WSDL::SOAP::Typelib::Fault11 object that has no visible relation to the request.

I've also tried using the debugger but I'm having trouble finding the actual request part. I've not yet understood how to tell the debuger to skip to a specific part deep inside a complex number of packages.

like image 885
simbabque Avatar asked Jun 12 '26 00:06

simbabque


1 Answers

I stumbled across this, having the same problem myself. I found the answer is using both options that raina77ow listed.

$service->outputxml(1);

returns the whole SOAP envelope xml, but this needs to be combined with

$service->no_dispatch(1);

With no_dispatch set, the SOAP request is printed, instead of the reply from the request. Hopefully this can help others.

like image 109
Jim Howard Avatar answered Jun 14 '26 04:06

Jim Howard