开发者

Python and SOAP [closed]

开发者 https://www.devze.com 2023-03-08 01:22 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消