The following is a rather long message. Here is a summary of my questions
below:
1. ZSI fails on a TypeError when using ZSI.ServiceProxy, why?
2. Is there a way to use cookie authentification with SOAPpy
(client-side)?
IIRC, ZSI is. Certainly there is no solid WSDL implementation.
I downloaded and installed both ZSI (1.5) and SOAPpy (0.11.4) both from
<
http://pywebsvcs.sourceforge.net/>. ZSI only required PyXML (0.8.3, from
<
http://pyxml.sourceforge.net/>) to be available, SOAPpy needed PyXML as
well as fpconst (0.7.0, from
<
http://www.analytics.washington.edu/statcomp/projects/rzope/fpconst/>)
My problem concerns doing two things:
1. First, I need to log in at a secure server. In return I get a cookie
that functions as user authentification.
2. Second, I need to upload a local file to a specific place on the server
using the cookie as authentification.
I got the login part working nicely using SOAPpy:
Whereas ZSI failed on a TypeError:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/ZSI/ServiceProxy.py", line
278, in __call__
return self.parent()._call(self.__name__, *args, **kwargs)
File "/usr/local/lib/python2.3/site-packages/ZSI/ServiceProxy.py", line
83, in _call
nsdict=self._nsdict, soapaction=soapAction, requesttypecode=request)
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 209,
in Send self.h.connect()
File "/usr/local/lib/python2.3/httplib.py", line 960, in connect
sock.connect((self.host, self.port))
Any ideas what this might be? I gather I would need to set the port to 443
somewhere, but I can't find the right place.
The second part, i.e. the upload, is trickier. Using SOAP::Lite in Perl,
one can specify a cookie to use for authentification, but I can seem to
find that in the documentation of SOAPpy. So how do I do cookie
authentification with SOAPpy (or ZSI for that matter)??
Here is the Perl SOAP::Lite code that does the trick (copied from
<
http://guide.soaplite.com/>):
use SOAP::Lite;
use HTTP::Cookies;
my $soap = SOAP::Lite
-> uri('urn:xmethodsInterop')
-> proxy('
http://services.xmethods.net/soap/servlet/rpcrouter',
cookie_jar => HTTP::Cookies->new(ignore_discard => 1));
print $soap->echoString('Hello')->result;
I need something like that 'cookie_jar' parameter in SOAPpy too. Help and
thanks!
/Mickel