Python Zeep headers are a pain in the a**, please help me out.
Posted by Remarkable_Pianist_2@reddit | learnprogramming | View on Reddit | 2 comments
Hey everyone, i am a Junior Django Developer, and i need to use Zeep to connect with a Soap Server.
Documentation on Soap servers is scarce, so i would really like your help in modyfying it, cause i keep getting this :
ValueError : Invalid value for _soapheaders.
This is the code.
(if i remove the header, it works as it should based on the serverside description.
Thanks in advance.
header = """<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" mlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2">
<wsse:Username>***********************************</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">*****</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>"""
print(client.service.releaseMngtAfe(audit_record,release_input,_soapheaders=header_dict))
Buttleston@reddit
so, what is _soapheaders expecting?
where does "client" come from? Like is it a 3rd party library? Is it your own code?
Does it, or the service you're integrating with, have any examples, in any language?
Remarkable_Pianist_2@reddit (OP)
It is used to connect to an external server. I dont quite understand the question tbh.
Ive seen in stackoverflow, people use header_value = header( a very hectic structure of nested lists/dicts) thats what i wanna do.