SOAP API: ошибки при отправке запроса с использованием seep - PullRequest
0 голосов
/ 27 ноября 2018

Я использую 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 ()?

...