我正在使用zeep访问SOAP API。这是我的Python:
import zeep
from requests import Session
from zeep.transports import Transport
https_proxy = "cloudproxy.xxx.com:1234"
proxy_settings = {
"https" : https_proxy,
"http" : https_proxy
}
wsdl = 'file://C:/Users/xxx/Desktop/xxxx.wsdl'
session = Session()
session.proxies = proxy_settings
client = zeep.Client(wsdl=wsdl,transport=Transport(session=session))
#client.wsdl.dump()
# I am not sure how to edit the request below -->
result = client.service.getConfig(userID='user1', password='password')
print (result)
API函数称为getConfig,示例请求如下:
<soapenv:Header/>
<soapenv:Body>
<r20:getConfig>
<!--Optional:-->
<servicePass>
<!--Optional:-->
<!--type: string-->
<userID>user1</userID>
<!--Optional:-->
<!--type: string-->
<password>password</password>
</servicePass>
</r20:getConfig>
</soapenv:Body>
如何编辑client.service.getConfig()?