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 ???
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
精彩评论