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

Hi

I am a newbie to perl so please bare with me..

I need to create a script that will do a http post of a SOAP request to a server and wait for response. Our system has changed to include WSSE security header for the SOAP request.. Now i am so lost on what to use soap lite or LWP. LWP means i will need to create the xml request manually? Here is the expected request packet, please can you advice on how i should go about this...
POST /lbs HTTP/1.1 Content-Type: application/soap+xml;charset=UTF-8 User-Agent: Jakarta Commons-HttpClient/3.0.1 Host: xxxxxxxxxx Content-Length: 949 <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xm +lns:urn="urn:IBS_WS_IMPLEMENTATION"> <soap:Header> <wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasi +s-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><w +sse:UsernameToken wsu:Id="UsernameToken-xxxxx" xmlns:wsu="http://docs +.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.x +sd"><wsse:Username>xxxx</wsse:Username><wsse:Password Type="http://do +cs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile +-1.0#PasswordText">xxxxxx</wsse:Password><wsse:Nonce>CU4+WBi/+E8HY8/2 +nYLf1A==</wsse:Nonce><wsu:Created>2009-12-01T15:35:13.942Z</wsu:Creat +ed></wsse:UsernameToken></wsse:Security></soap:Header> <soap:Body> <urn:getLocation> <MSISDN>xxxxxxx</MSISDN> <CLIENTID>xxxxx</CLIENTID> <EXT_TRANS_ID>xxxxxxx</EXT_TRANS_ID> </urn:getLocation> </soap:Body> </soap:Envelope>
Thank you monks....

Replies are listed 'Best First'.
Re: HTTP POST OF SOAP REQUEST
by Utilitarian (Vicar) on Dec 01, 2009 at 16:20 UTC
    You should take a look at the Writing a SOAP client chapter in the SOAP::Lite docs.
    When you create the SOAP::Lite object you include the server name, then use call and return methods to send and retrieve from the server.

    print "Good ",("night","morning", "afternoon", "evening")[int((localtime)[2]/6)]," fellow monks.";