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

Any help would be appreciated ... I tried to use SOAP::Lite to pass a query to a web service requesting data. Had any number of errors and sometimes no error just a response of '1' using the examples provided in the on line tutorials for SOAP::Lite.

I am able to run the same request using HTTP::Request and LWP::UserAgent modules in the code below. I'd still like to know how, if possible, to pass the same query using SOAP::Lite instead.

Thank you in advance.

########################################################### require HTTP::Request; require LWP::UserAgent; #this gets the response from the iridium server $request = HTTP::Request->new(GET => 'https://www.NAME_OF_THE_SERVER/ +xml/service1.asmx/XmlResponse?request=<Request RequestTime="2009-09-0 +7T00:20:55+00:00" Server="JOHN_DOE"><Username>USERNAME</Username><Pas +sword>PASSWORD</Password><DeliverData><MaxMessages>100</MaxMessages>< +/DeliverData></Request>'); $ua = LWP::UserAgent->new; $response = $ua->request($request); print $response; print $response->as_string; open (MYFILE, '>>C:\\perl\\webservice\\data.txt'); print MYFILE $response->as_string; close (MYFILE); ###########################################################

Replies are listed 'Best First'.
Re: SOAP::Lite vs LWP
by Sewi (Friar) on Sep 09, 2009 at 11:37 UTC
    It is possible to form a SOAP request "manually", I did this on a server where SOAP::* was not installable.
    You should do a (successful) SOAP-Request and trace the request and reply using tcpdump or any other tool. Otherwise you would need to rebuild the whole SOAP headers, etc.

    This solution is not good at all. It will work as long as nothing at the API changes. Be prepared for unexpected updates which will require you to repeat the work.