我以前从未使用过SOAP,对Python也有点陌生。我这样做是为了让自己熟悉这两种技术。我已经安装了soapplib,并试图阅读他们的客户端文档,但我不太理解它。是否还有其他更适合作为Python的SOAP客户端库的东西?

编辑:为了以防万一,我使用的是Python 2.6。


当前回答

我们使用了来自Python Web Services的SOAPpy,但似乎ZSI(同一来源)正在取代它。

其他回答

只是供大家参考的警告,在此问题解决之前,SUDS不支持WSDL中的“choice”标签:

https://fedorahosted.org/suds/ticket/342

看到的: 肥皂水和选择标签

更新(2016):

如果您只需要SOAP客户机,有一个维护良好的库叫做zeep。它同时支持Python 2和Python 3:)


更新:

除了上面提到的,我还会提到Python WebServices页面,它总是最新的,包括所有主动维护的模块和推荐的SOAP和所有其他webservice类型的模块。


不幸的是,目前我不认为有一个“最好的”Python SOAP库。每一种主流方法都有其优缺点。

老库:

是“最好的”,但不再保持。在Python 2.5+上不工作 ZSI:使用起来非常痛苦,开发也很慢。有一个名为“SOAPpy”的模块,它与上面的SOAPy不同。

“新”库:

SUDS: Very Pythonic, and easy to create WSDL-consuming SOAP clients. Creating SOAP servers is a little bit more difficult. (This package does not work with Python3. For Python3 see SUDS-py3) SUDS-py3: The Python3 version of SUDS spyne: Creating servers is easy, creating clients a little bit more challenging. Documentation is somewhat lacking. ladon: Creating servers is much like in soaplib (using a decorator). Ladon exposes more interfaces than SOAP at the same time without extra user code needed. pysimplesoap: very lightweight but useful for both client and server - includes a web2py server integration that ships with web2py. SOAPpy: Distinct from the abandoned SOAPpy that's hosted at the ZSI link above, this version was actually maintained until 2011, now it seems to be abandoned too. soaplib: Easy to use python library for writing and calling soap web services. Webservices written with soaplib are simple, lightweight, work well with other SOAP implementations, and can be deployed as WSGI applications. osa: A fast/slim easy to use SOAP python client library.

以上,我个人只使用过SUDS,而且我非常喜欢它。

肥皂水很不错。我尝试了SOAPpy,但没有得到它的工作方式,我需要而肥皂水工作得很直接。

我有很好的治疗sudds的经验 https://fedorahosted.org/suds

使用他们的TestSuite作为文档。

我们使用了来自Python Web Services的SOAPpy,但似乎ZSI(同一来源)正在取代它。