Reputation: 63
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.
Upvotes: 5
Views: 5145
Reputation: 86
this one works just fine
client.transport.session.headers.update({'yourHeader': 'yourValue'})
Upvotes: 2
Reputation: 1259
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
Upvotes: 8