python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

no generate <wsse:Nonce EncodingType

Open yeramirez opened this issue 3 years ago • 0 comments

I am trying to consume a service, all the xml is generated correctly except this part, how can this tag be generated, thank you very much in advance

timestamp_token = WSU.Timestamp() today_datetime = datetime.datetime.today() expires_datetime = today_datetime + datetime.timedelta(minutes = 5)

timestamp_elements = [ WSU.Created(today_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")), WSU.Expires(expires_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")) ] timestamp_token.extend(timestamp_elements)

user_name_token = UsernameToken('2-95','wzxxxxx',timestamp_token=timestamp_token) wsdl_client = Client( wsdl=wsdl_url, wsse=[user_name_token, signature], transport=transport )

it generates:

wsse:UsernameToken wsse:Username2-901705</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">wzPxxxx</wsse:Password> </wsse:UsernameToken> <wsu:Timestamp wsu:Id="id-1b7e34ff-0f38-4651-a456-8a4f4011903b"> wsu:Created2022-12-25T20:03:16Z</wsu:Created> wsu:Expires2022-12-25T20:08:16Z</wsu:Expires> </wsu:Timestamp>

but the service expects this:

<wsse:UsernameToken wsu:Id="UsernameToken-D01D11BA2CAF83D4FD16720147918422"> wsse:Username2-90155 </wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">wzxxxx</wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">v47Jj/bIOMI5PIWFsdzalw==</wsse:Nonce> wsu:Created2022-12-26T00:33:11.842Z</wsu:Created> </wsse:UsernameToken>

yeramirez avatar Dec 26 '22 16:12 yeramirez