views:

17670

answers:

14

I've never used SOAP before and I'm sort of new to Python. I'm doing this to get myself acquainted with both technologies. I've installed SOAPlib and I've tried to read their Client documentation, but I don't understand it too well. Is there anything else I can look into which is more suited for being a SOAP Client library for Python?

Edit: Just in case it helps, I'm using Python 2.6.

A: 

Could this help: http://users.skynet.be/pascalbotte/rcx-ws-doc/python.htm#SOAPPY

I found it by searching for wsdl and python, with the rational being, that you would need a wsdl description of a SOAP server to do any useful client wrappers....

Daren Thomas
A: 

We'd used SOAPpy from Python Web Services, but it seems that ZSI (same source) is replacing it.

Just Some Guy
+12  A: 

I had good experience with SUDS https://fedorahosted.org/suds

Used their TestSuite as documentation.

+67  A: 

Unfortunately, at the moment, I don't think there is a "best" Python SOAP library. Each of the mainstream ones available has its own pros and cons.

Older libraries:

  • SOAPy: Was the "best," but no longer maintained. Does not work on Python 2.5+
  • ZSI: Very painful to use, and development is slow. Has a module called "SOAPpy", which is different than SOAPy (above).

"Newer" libraries:

  • SUDS: Very Pythonic, and easy to create WSDL-consuming SOAP clients. Creating SOAP servers is a little bit more difficult.
  • soaplib: Creating servers is easy, creating clients a little bit more challenging.

Of the above, I've only used SUDS personally, and I liked it a lot.

Samat Jain
Python 2.5.2, SOAPpy 0.12.0 and my SOAP clients work.
bortzmeyer
Looks like you misspelled SOAPpy. Or do soappy and soapy both exist? Either way you might want to edit to clarify
amarillion
SOAPy and SOAPpy are actually different. I've edited to clarify, and turned the post into a community wiki.
Samat Jain
+1 for SUDS, great library! I ran into problems using SUDS with HTTPS web services behind a proxy. Turns out it is a known Python `urllib2` issue. See my answer for more details.
sstock
I've personally, had a lot of success with SOAPpy. Although, I've occasionally had to write some wrappers to fix some things. ( .NET consuming, WSDL serving )
sfossen
A: 

As I suggested here I recommend you roll your own. It's actually not that difficult and I suspect that's the reason there aren't better Python SOAP libraries out there.

Greg
+3  A: 

SUDS is the way to go, no question about it.

+12  A: 

I followed the advice of other answers to this question and gave SUDS a try. After using it "in anger" I must agree: SUDS is very nice! Highly recommended!

I did run into trouble calling HTTPS-based web services from behind a proxy. At the time of this writing, this affects all Python web-service clients that use urllib2, so I'll document the solution here.

The urllib2 module shipping with python 2.6.2 and below will not issue a CONNECT to the proxy for HTTPS-over-HTTP-proxy sessions. This results in a long timeout, or if you are lucky, an error that looks like:

abort: error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

This is issue1424152 on the Python bug tracker. There are patches attached to the bug report that will fix this in Python 2.x and Python 3.x.

sstock
+1  A: 

Anyone have an example of a SUDS web services server. Their client is great.

+3  A: 

SUDS is easy to use, but is not guaranteed to be re-entrant. If you're keeping the WSDL Client() object around in a threaded app for better performance, there's some risk involved. The solution to this risk, the clone() method, throws the unrecoverable Python 5508 bug, which seems to print but not really throw an exception. Can be confusing, but it works. It is still by far the best Python SOAP client.

Gloria
A: 

Im using SOAPpy with Python 2.5.3 in a production setting.

I had to manually edit a couple of files in SOAPpy (something about header code being in the wrong place) but other than that it worked and continues to do so very reliably.

carl
We did the same and are using SOAPpy with Python 2.6.3.
Joe L.
+1  A: 

We released a new library: PySimpleSOAP, that provides support for simple and functional client/server. It goals are: ease of use and flexibility (no classes, autogenerated code or xml is required), WSDL introspection and generation, WS-I standard compliance, compatibility (including Java AXIS, .NET and Jboss WS). It is included into Web2Py to enable full-stack solutions (complementing other supported protocols such as XML_RPC, JSON, AMF-RPC, etc.).

If someone is learning SOAP or want to investigate it, I think it is a good choice to start.

A: 

Had good Experience with suds http://luna.codeplex.com/SourceControl/changeset/view/48188#540316

M.J
A: 

I believe soaplib has deprecated its SOAP client ('sender') in favor of suds. At this point soaplib is focused on being a web framework agnostic SOAP server ('receiver'). Currently soaplib is under active development and is usually discussed in the Python SOAP mailing list:

http://mail.python.org/mailman/listinfo/soap

bradallen137
A: 

What we was discussing in soap[at]python.org is has a really agnostic SOAP server with pythonic implementation; conversations fall in TGWS and soaplib as the best candidates. The best way to help a project for SOAP is join us and talk about in soap[at]python.org http://code.google.com/p/pysimplesoap/ looks good i think this people can contribute too.

In my conclusion we have this:

Soap client side:

use only Suds

Soap server side:

We have TGWS, soaplib (pysimplesoap not tested) IMHO use and help soaplib must be the choice.

my 2cents

Best regards,

Cristian Salamea