我以前从未使用过SOAP,对Python也有点陌生。我这样做是为了让自己熟悉这两种技术。我已经安装了soapplib,并试图阅读他们的客户端文档,但我不太理解它。是否还有其他更适合作为Python的SOAP客户端库的东西?
编辑:为了以防万一,我使用的是Python 2.6。
我以前从未使用过SOAP,对Python也有点陌生。我这样做是为了让自己熟悉这两种技术。我已经安装了soapplib,并试图阅读他们的客户端文档,但我不太理解它。是否还有其他更适合作为Python的SOAP客户端库的东西?
编辑:为了以防万一,我使用的是Python 2.6。
当前回答
更新(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,而且我非常喜欢它。
其他回答
毫无疑问,sudds是正确的选择。
http://users.skynet.be/pascalbotte/rcx-ws-doc/python.htm#SOAPPY有帮助吗
我通过搜索wsdl和python找到了它,理性的是,您将需要SOAP服务器的wsdl描述来执行任何有用的客户端包装....
更新(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,而且我非常喜欢它。
我们发布了一个新的库:PySimpleSOAP,它提供了对简单实用的客户端/服务器的支持。它的目标是:易用性和灵活性(不需要类、自动生成代码或xml)、WSDL自省和生成、符合WS- i标准、兼容性(包括Java AXIS、. net和Jboss WS)。它被包含在Web2Py中,以支持全栈解决方案(补充其他支持的协议,如XML_RPC、JSON、AMF-RPC等)。
如果有人正在学习SOAP或想要研究它,我认为这是一个很好的开始。
SUDS易于使用,但不能保证可再入。如果您在线程应用程序中保留WSDL Client()对象以获得更好的性能,则会涉及一些风险。此风险的解决方案是clone()方法,它会抛出不可恢复的Python 5508错误,该错误似乎打印了异常,但并没有真正抛出异常。可能会让人困惑,但它很有效。它仍然是迄今为止最好的Python SOAP客户机。