Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

WSDL and SOAP::Lite question

by slayedbylucifer (Scribe)
on Aug 08, 2012 at 11:39 UTC ( #986229=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on WSDL and SOAP::Lite question
Select or Download Code
Re: WSDL and SOAP::Lite question
by Anonymous Monk on Aug 08, 2012 at 12:06 UTC
      Thanks for the suggestion. Right now i am working on something else. I Will get back to the SOAP thing soon and will post my out-comings on this thread.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986229]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2014-12-20 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls