Which is the most mature Soap module?

Mickel Grönroos mickel at csc.fi
Tue Jun 8 09:31:21 CEST 2004


I abandoned trying to use the WSDL descriptions from SOAPpy and went back
to looking at ZSI. I got ZSI to work better when using ZSI.Binding (and
not ZSI.ServerProxy). I have two tasks I need to perform:

1. Run a login function with two string parameters ("username" and
"passwd")  on a SOAP server that returns a cookie

2. Run an upload function with two parameters (string "fullpath" and
base64 encoded "filecontent")  on another SOAP server adding the cookie to
the HTTP header being sent with the SOAP message

Part 1 works with the following code:

>>> import ZSI, sys
>>> loginservice = ZSI.Binding(url="https://hotpage.csc.fi/log/soap.phtml",
... ssl=True, host="hotpage.csc.fi")
>>> cookie = loginservice.login("username", "secretpass")[0]

Now I have the cookie in the unicode string "cookie"

Part 2 almost works with the following code:

>>> import base64
>>> data = base64.encodestring("the crap to upload")
>>> uploadservice.upload("/tmp/crap.txt", data)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 28, in
    requesttypecode=TC.Any(self.name, aslist=1))
  File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 143,
in RPC
    return self.Receive(replytype, **kw)
  File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 286,
in Receive
    raise FaultException(msg)
ZSI.FaultException: Denied access to method (upload) in class (main) at
/usr/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 2128.

I reckon the problem is I do not explicitly create a
ZSI.TC.Base64String object of the base64 encoded string. I have been
reading the docs of ZSI at <http://pywebsvcs.sourceforge.net/zsi.html> but
can't figure it out. Doing:

>>> base64data = ZSI.TC.Base64String("filecontent", default=data)
>>> uploadservice.upload("/tmp/crap.txt", base64data)

yields the same error message.

Any ideas? In particular, how do I send base64 encoded data in the SOAP



More information about the Python-list mailing list