Default SOAP Username Token has the following elements:
<wsse:UsernameToken>
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password>PASSWORD</wsse:Password>
</wsse:UsernameToken>
For the same I would to like an additional tokens say Domain & Organization, the schema should look like this,
<wsse:UsernameToken>
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password>PASSWORD</wsse:Password>
<Organization>ORGANIZATION</Organization>
<Domain>DOMAIN</Domain>
</wsse:UsernameToken>
So using Element tag, I appended the elements, here it goes.
wsse = ('wsse', 'http://schemas.xmlsoap.org/ws/2002/12/secext')
security = Element('Security', ns=wsse)
usernametoken = Element('UsernameToken', ns=wsse)
usernametoken.insert(Element('Username', ns=wsse).setText('USERNAME'))
usernametoken.insert(Element('Password', ns=wsse).setText('PASSWORD'))
usernametoken.insert(Element('Organization').setText('ORGANIZATION'))
usernametoken.insert(Element('Domain').setText('DEFAULT'))
security.insert(usernametoken)
Now when I try to set options for the same:
client.set_options(wsse=security)
Am getting the following error:
AttributeError: "wsse" must be: (<class suds.wsse.Security at 0xf552c0>,)
Looks like the type of token class is being changed... Am I missing something
Thanks