Основная проблема подключения к SOAP API с использованием Zeep и настройки параметров - PullRequest
0 голосов
/ 02 апреля 2019

Я пытаюсь подключиться к SOAP API с помощью Zeep, и я слишком незнаком, чтобы начать правильный путь.

Я пытался покопаться в WSDL, но не понимаю этого.

import zeep

dat_wsdl = 'http://cnx.test.dat.com:9280/wsdl/TfmiFreightMatching.wsdl'
client = zeep.Client(wsdl=dat_wsdl)
print(client.service.Login('tlog_cnx1', 'pAsSwOrD', 'OurCompany', 2))

Я не знаю, чего ожидать, но с ошибкой

TypeError: __init__() takes at most 1 positional arguments (4 given)

должно быть четыре параметра, loginId, password, thirdPartyId и apiVersion.Я не могу понять, что вызов функции правильный, и я пробовал много вещей.Мой собеседник на другой стороне не понимает Python, но посоветовал мне, что WSDL для вызова запроса на вход в систему:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tfm="http://www.tcore.com/TfmiFreightMatching.xsd">
<Header/>
<Body>
<tfm:loginRequest>
<tfm:loginOperation>
<tfm:password>*SANITIZED*</tfm:password>
<tfm:loginId>username</tfm:loginId>
<tfm:thirdPartyId>yourcustomername</tfm:thirdPartyId>
<tfm:apiVersion>2</tfm:apiVersion>
</tfm:loginOperation>
</tfm:loginRequest>
</Body>
</Envelope>

Любая помощь очень ценится ...

...