How can you set the username and password in the http header for a SOAP request message using python's zeep? I believe that is why i am getting a connection refused error but cannot figure out where the http header details can be set. I even tried just running python -mzeep on the wsdl file (vs creating a client and calling a web service method) but it still cannot connect.
Zeep uses the requests library for http requests. The request session is available as client.transport.session
.
So doing something like client.transport.session.headers.update({})
should work. See http://docs.python-requests.org/en/master/user/advanced/#session-objects
this one works just fine
client.transport.session.headers.update({'yourHeader': 'yourValue'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With