What is the best library that can be used to create a SOAP Server - Client with Python or implement client that can talk to SOAP Server ???
SOAP is a Web services technology favoured in certain environments. The following projects seek to support SOAP and related technologies such as WSDL: zeep (on PyPi) - Zeep is a modern and high performant SOAP client build on top of lxml and requests. It's well maintained, and compatible with Python 2 and 3.
If you're going to interact witha SOAP API you need a SOAP client to parse the WSDL url or else you won't be able to create a client to call like an RPC. Zeep is one that's available for Python. You can't just interact with it with CURL or something like that.
As for a SOAP client, my personal favourite is SUDS https://fedorahosted.org/suds/. It is very Pythonic and easy to use. Also you don't need to generate any code making it very useful for testing.
A simple example from its documentation (https://fedorahosted.org/suds/wiki/Documentation):
from suds.client import Client
url = 'http://localhost:7080/webservices/WebServiceTestBean?wsdl'
client = Client(url)
Now you can simply use client to call services. For instance in order to call getPercentBodyFat service (in the test case):
result = client.service.getPercentBodyFat('jeff', 68, 170)
print result
For more information about different SOAP libraries for Python, please see question 206154
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With