mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 586 forks source link

Cloudflare and <soap:Header> #1400

Open JonhSilver opened 10 months ago

JonhSilver commented 10 months ago

zeep 4.1.0

https://draudejai.sodra.lt/edas-external/services/DataService?wsdl

soapui5.7.0 auto create request is:

...............................iftd......uKjQ==2023-12-07T18:47:13.542Z and working fine python zeep create request is: and get Cloudflare chalange why this happens and how to fix? ``` class MyLoggingPlugin(Plugin): def egress(self, envelope, http_headers, operation, binding_options): if not DEBUG: return # Format the request body as pretty printed XML xml = etree.tostring(envelope, pretty_print=True, encoding='unicode') print(f'\nRequest\n-------\nHeaders:\n{http_headers}\n\nBody:\n{xml}') def ingress(self, envelope, http_headers, operation): if not DEBUG: return # Format the response body as pretty printed XML xml = etree.tostring(envelope, pretty_print=True, encoding='unicode') print(f'\nResponse\n-------\nHeaders:\n{http_headers}\n\nBody:\n{xml}') session = Session() session.trust_env = True session.verify = True DEBUG = True from zeep.wsa import WsAddressingPlugin client = Client( wsdl=wsdl , wsse=UsernameToken(Username, Password) , transport=Transport(session=session) ,plugins=[MyLoggingPlugin(),WsAddressingPlugin()] ) with client.settings(raw_response=True): node = client.service.uploadEdasDraft(uploadedFileName, encoded_string) ```