tilly has asked for the wisdom of the Perl Monks concerning the following question:
What I'm supposed to do is call the login method, then go on to call methods that do work, then logout when I'm done. I'm able to call the login method. I can tell that login worked. But then I'm unable to do anything else.
Here is some sample code:
The response I get is:#! /usr/bin/perl -wl use strict; use SOAP::Lite; use Data::Dumper; $Data::Dumper::Indent = 1; my $soap = SOAP::Lite->uri( 'https://ws1.responsys.net/webservices/ResponsysWS?wsdl' )->proxy( 'https://ws1.responsys.net/webservices/ResponsysWS?wsdl' ); my $return = $soap->login('USER', 'PASSWORD'); #print Dumper($return); if ($return->fault) { die $return->faultstring; } $return = $soap->listFolders(); if ($return->fault) { die $return->faultstring; }
which is coming from the attempt to call listFolders. (If you run this you'll get a different error since I haven't provided you with the right login information - login really did something.) So obviously there is an RIAccount object that I need to find and do something. But I can't find anything appropriate when I look through the datastructures I have available in $soap or $response.java.rmi.RemoteException: RIAccount object is not available in session + at test.pl line 24.
When I compare with the Java code example in the documentation I see an interesting call to:
that looks like it could be relevant to keeping a login around. But I can't figure out what the Perl equivalent might be. (If there is one.)((ResponsysWSSoapBindingStub) service).setMaintainSession(true);
Of course the interface is defined with WSDL. And if I look at WSDL examples in Perl, I see that might be better off calling the session method. However that produces an immediate error. Based on http://support.microsoft.com/kb/308438 I tried downloading the WSDL and deleting the wsdl:portType section. Now I don't get an error, but I get nothing back from:
which isn't very useful. Possibly related is that the datastructure of $soap includes a fault:#! /usr/bin/perl -wl use strict; use SOAP::Lite; use Data::Dumper; $Data::Dumper::Indent = 1; my $soap = SOAP::Lite->service( 'file://users/btilly/responsys/ResponsysWS.wsdl' )->proxy( 'https://ws1.responsys.net/webservices/ResponsysWS?wsdl' ); $soap->login('USER', 'PASSWORD'); print $soap->listFolders;
and I don't know where this comes from.'org.xml.sax.SAXParseException: The value of the attribute "p refix="xmlns",localpart="namesp1",rawname="xmlns:namesp1"" is invalid. + Prefixed namespace bindings may not be empty.'
Does anybody have ideas for what else I can try to be able to login to the service then start calling useful methods? (If it involves ignoring the WSDL and hand-coding stuff, I'm fine with that as long as I have an example to work from to let me know what I should be hand-coding.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite and sessions?
by ForgotPasswordAgain (Vicar) on Jul 19, 2007 at 15:54 UTC | |
by tilly (Archbishop) on Jul 23, 2007 at 17:27 UTC | |
by Anonymous Monk on Apr 18, 2008 at 15:34 UTC | |
by polera (Initiate) on Apr 18, 2008 at 15:38 UTC | |
by erroneousBollock (Curate) on Jul 19, 2007 at 23:17 UTC | |
by ForgotPasswordAgain (Vicar) on Jul 20, 2007 at 07:55 UTC | |
by tilly (Archbishop) on Jul 23, 2007 at 17:37 UTC |