Hey guys, Im killing myself over this soap-lite script I have written. Its using an asp.net SOAP server, so in my experience, its best to pass through the soap information through raw XML, if you know what the servers expecting. Here is what its expecting.
POST /services/svrLogin.asmx HTTP/1.1 Host: website.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/ControlNET/svrLogin/GetCreds" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x +mlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schema +s.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCreds xmlns="http://tempuri.org/ControlNET/svrLogin"> <Username /> <Password /> </GetCreds> </soap:Body> </soap:Envelope>
And this is what im passing to it.. (per my Data Dump in Perl)
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCreds xmlns="http://tempuri.org/ControlNET/svrLogin"> <Username>username</Username> <Password>********(hidden)**********</Password> </GetCreds> </soap:Body> </soap:Envelope>
Now I know its interacting with the right namespace, but it should be returning some proper information about the server its interacting with, however the response is "Failed to authenticate the proper username and password" Any idea what I could be doing wrong? I know the password is 100% right. Here is the code as well
#!c:/perl/bin use SOAP::Lite+trace => 'all'; use XML::Simple; use Data::Dumper; system("cls"); $method = 'GetCreds'; $ep = 'http://website.com/services/svrLogin.asmx'; $uri = 'http://tempuri.org/ControlNET/svrLogin'; $xml = '<Username>username</Username> <Password>********(hidden)**********</Password>'; $soap = SOAP::Lite -> proxy ($ep) -> uri($uri) -> on_action( sub { join '', $uri, $_[1] } ) -> readable(1) -> call ($method => SOAP::Data->type('xml' => $xml)); print Dumper($soap);
Any ideas?

In reply to soap-lite issue by alwaysuseperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.