slayedbylucifer has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WSDL and SOAP::Lite question
by Anonymous Monk on Aug 08, 2012 at 12:06 UTC | |
by slayedbylucifer (Scribe) on Aug 09, 2012 at 05:36 UTC |