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 ???
Asked
Active
Viewed 2,639 times
5
-
I'm confused: are you looking for a SOAP client int Python or do you need to implement a SOAP server as well? – jsalonen May 25 '11 at 08:49
-
need a soap server or client? – May 25 '11 at 09:07
-
possible duplicate of [What's the best SOAP client library for Python, and where is the documentation for it?](http://stackoverflow.com/questions/206154/whats-the-best-soap-client-library-for-python-and-where-is-the-documentation-f) – Jul 26 '12 at 23:04
1 Answers
11
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