Im not a developer, I was given a task to rewrite an old perl code to Python3.
It query a SOAP interface with 2 parameter.
The perl code is working fine, but the python rewrite does not.
My code is:
#!/usr/bin/env python
import os
import zeep
from zeep.transports import Transport
ksz="12345678"
szd="19700101"
transport = Transport()
transport.session.verify = False
wsdl_url = "https://10.2.2.2/soap.wsdl"
soap = zeep.Client(wsdl=wsdl_url,transport=transport)
result = soap.service.CardIdf(carid=ksz,bdate=szd)
print(result)
When I run script, it gives “Invalid method”. The SOAP interface operator told me to add the namespace to envelope header (xmlns:typens=”urn:CC”) , but I dont know exactly, how to do that.
Tried with this example https://www.geeksforgeeks.org/making-soap-api-calls-using-python/
I tried with _soapheaders=[header] in client.service.CardIdf, but cannot make it working. Any help would be appreciated!
https://www.geeksforgeeks.org/making-soap-api-calls-using-python/
as example