SOAP frustrations

Andrew Dalke adalke at mindspring.com
Tue Oct 15 15:39:48 EDT 2002


Hey all,

   I've been working with one of my clients trying to get a SOAP
interface going for a project.  I've had a rather frustrating time
trying to get it to work, and am using this as a chance to vent.

   The first problem was choosing a SOAP client&server library.  The
choices were:
   - /F's soaplib
   - ZSI
   - SOAP.py
(I didn't look at SOAPy because we aren't using WSDL.)

We excluded soaplib because we wanted Python/Perl/Java interoperability
and http://www.pythonware.com/products/soap/profile.htm suggests
problems with that, with unicode, with namespaces, and a few more.

Various people recommended ZSI.  I tried the most recent distribution
(ZSI1.3RC2 from May 14, 2002) and the tests failed, since there's a
bug in ZSI/TCapache.py line 44.  The distribution has
         print >>sw, "<%s%s%s>" % n, attrtext or '', tstr
and should be
         print >>sw, "<%s%s%s>" % (n, attrtext or '', tstr)

That makes me skittish about the rest of the code.

(NOTE TO ALL -- if you have self-tests, please make sure they work!)

In addition, I'm rather confused about terms like "actor" which
appear in the documentation, and the coding style is kinda unusual
(method names starting with a capital letter throws me off, as does
indentation like
     def __init__(self, out,
     envelope=1, encoding=SOAP.ENC, header=None, nsdict=None, **kw):
instead of
     def __init__(self, out,
                  envelope=1, encoding=SOAP.ENC, header=None,
                  nsdict=None, **kw):
or
     def __init__(self, out, envelope=1, encoding=SOAP.ENC, header=None,
                  nsdict=None, **kw):
and lack of indentation like
         if not self.envelope: return
)

Nothing serious, but it made it hard to figure out the code.


We ended up using SOAP.py, since it was easy to set up and get
working for our experimental project.  OTOH, I just spent most this
day trying to make it work as a .cgi instead of running as its own
server.  (We already have Apache running, so having two servers seems
like overkill.)  As far as I can tell, you need to roll your own
for that, so I did.  By comparison, the docs for ZSI say it can be
done with

from ZSI import dispatch
dispatch.AsCGI()

and in the SOAP book by Snell/Tidwell/Kulchenko, published by O'Reilly,
the SOAP::Lite equivalent is also simple.

use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI ->
                dispatch_to('Hello::(?:sayHello)') -> handle;


In addition, SOAP.py has similar coding style pecularities, and there's
some bug that comes up in Python 2.2 because of changes in Python's
type/class system.  (We're using Python 2.1 so it isn't yet a problem.
I also haven't tested ZSI to see if this is a problem.)

Finally, it seems that neither SOAP.py nor ZSI are actively developed.
There hasn't been a recent release of either package, and the CVS logs
show little change.

All in all, it's rather discouraging for me to work with SOAP in
Python, and that's given a rather non-trivial amount of experience
in doing Python.  I would think others have worse problems.

It's such that the more CS-y people at my client's site believe that
web services in Python are still very immature and want to switch the
project over to Java and WebLogic(!).  (I did point out that developing
the library I did was still less time than setting that up, but there
are other factors in the mix as well.)


What I don't get is, I figure there's enough people doing web services/
SOAP with Python that there shouldn't be these problems.  Why then am
I so frustrated with it?

					Andrew Dalke
					dalke at dalkescientific.com




More information about the Python-list mailing list