We are using "BasicHTTPBinding WSS Type - PasswordText" authentication. I can successfully send the request manually using SoapUi tool, but in Zeep below code throws 500 internal server error and the response is
An error occurred when verifying security for the message.
headers = {'content-type': 'text/xml'}
url = r'https://xxxxxxxxxxxxxxxx/Services/LoansIntegrationService.svc?singleWsdl'
client = Client(url ,wsse=UsernameToken('vvasu', 'demo'))
body = client.transport.load(r'.\wsdl\LoanRequest.wsdl') #fetch the updated wsdl file and pass it to request
result = client.transport.post(message=body, address=url, headers=headers)
print(result.content) #An error occurred when verifying security for the message.
Response:
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</faultcode>
<faultstring xml:lang="en-US">An error occurred when verifying security for the message.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>```