Hi,

THis is my 1st attempt at dealing with WSDL and perl. I am learning how to create a SOAP client in perl.

Here is the method I run in soapUI:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xm +lns:soap1="http://www.surgient.com/50/VcsApi/SoapAdapter"> <soap:Header/> <soap:Body> <soap1:Login> <soap1:organizationId>1</soap1:organizationId> <!--Optional:--> <soap1:userName>my_username</soap1:userName> <!--Optional:--> <soap1:password>my_password</soap1:password> </soap1:Login> </soap:Body> </soap:Envelope>

and here is the responce I get in soapUI

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xm +lns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http:/ +/www.w3.org/2001/XMLSchema"> <soap:Body> <LoginResponse xmlns="http://www.surgient.com/50/VcsApi/SoapAdap +ter"> <LoginResult> <SessionId>3144920</SessionId> <AccountId>2</AccountId> <OrganizationId>1</OrganizationId> <Token>fsTTTxUZml7QY/mu3TCkKqzrBbQ=</Token> </LoginResult> </LoginResponse> </soap:Body> </soap:Envelope>

You can see that I am able to get the "session ID" and "Token" from above output in soapUI.

Now I want to retrieve the same information using perl. so this is hte code I have written:

#!/usr/bin/perl -w use strict; use SOAP::Lite; use Data::Dumper; my $soap = SOAP::Lite -> uri ('http://my_website/Services/SoapAdapter.asmx?WSDL' +) -> proxy ('http://my_website/Services/SoapAdapter.asmx?WSD +L'); my $something = $soap->Login (1, 'my_username', 'my_password'); print $something;

and perl script gives me only "1" as the output irrespective of whether I pass correct password or wrong. so This makes me feel that my script is not really getting through the authentication.

Could you tell me where I am going wrong. Thanks


In reply to WSDL and SOAP::Lite question by slayedbylucifer

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.