SOAP 1.2 python 客户端 [英] SOAP 1.2 python client
问题描述
我正在寻找一个 python SOAP 1.2 客户端,但它似乎不存在.所有现有的客户端要么不维护,要么只与 SOAP 1.1 兼容:
I am looking for a python SOAP 1.2 client but it seems that it does not exist . All of the existing clients are either not maintainted or only compatible with SOAP 1.1:
- 泡沫
- SOAPpy
- ZSI
推荐答案
zeep 库支持 SOAP 1.1 和 1.2,只要服务的 WSDL 正确指明.
The zeep library supports both SOAP 1.1 and 1.2 as long as the service's WSDL properly indicates it.
WSF/Python 支持 SOAP 1.2.
WSF/Python is supporting SOAP 1.2.
WSF/Python 是 WSO2 WSF/C 的 Python 语言扩展[http://www.wso2.org/projects/wsf/c].此版本使您能够使用/提供 Web 服务REST 和 SOAP.
INTRODUCTION
WSF/Python is the Python language extension to WSO2 WSF/C [http://www.wso2.org/projects/wsf/c]. This version enables you to consume/provide Web Services both with REST and SOAP.
- 支持 REST
- 支持 SOAP 1.1
- 支持 SOAP 1.2
对于下载,您无需注册.只需点击最底部的提交"即可.
For downloading, you don't have to register. Just click "submit" at the very bottom.
可以在下载的存档中找到示例,例如:
Samples can be found within the downloaded archive, eg:
LOG_DIR = '/tmp/'
LOG_LEVEL = 4
WSFC_HOME = '/opt/wso2/wsf_c'
END_POINT = 'http://localhost:9090/axis2/services/echo/echoString'
if __name__ == '__main__':
message = """
<ns1:echoString xmlns:ns1="http://ws.apache.org/axis2/services/echo">
<text>Hello World!</text>
</ns1:echoString>
"""
try:
client = wso2.wsf.WSClient({
'to':END_POINT,
'WSF_LOG_DIR':LOG_DIR,
'WSF_LOG_LEVEL':LOG_LEVEL,
'WSFC_HOME':WSFC_HOME,
})
print 'Sending: ' + message
response = client.request(message)
if response is not None:
print 'Respose: ' + response + '
'
else:
print 'Error occurred!'
except wso2.wsf.WSFault, e:
print 'Exception occurred:'
print e
这篇关于SOAP 1.2 python 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!