Hello Peter, list
I'm trying to create a SOAP request to send to a web service that expects a
wsse:UsernameToken element in the SOAP header.
Following the OASIS docs here[1] I'm trying to create the UsernameToken
element with PyXB.
I'm using something like the following:
from pyxb.bundles.wssplat import wsse
unt = wsse.UsernameToken()
unt.Username = "myuser"
unt.Password = wsse.Password("mypass", Type="PasswordText")
print(unt.toDOM().toprettyxml()) # the Password element does not show
Which results in:
<?xml version="1.0" ?>
<ns1:UsernameToken xmlns:ns1="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
">
<ns1:Username>ricardogsilva</ns1:Username>
</ns1:UsernameToken>
The code runs without error, but the wsse.Password element does not appear
when I call the toDOM() method. So I guess I'm creating it the wrong way.
How would I achieve my goal?
[1] -
https://www.oasis-open.org/committees/download.php/13392/wss-v1.1-spec-pr-UsernameTokenProfile-01.htm
--
___________________________ ___ __
Ricardo Garcia Silva
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
pyxb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyxb-users