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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.