Because a WS-Security token is just an XML document stored inside the header of a soap message, you can easily support this in IS versions prior to 7.1.
Build a utility service to return a soap envelope containing a ws-security token or simply to return a valid token as an IS node or XML string.
- Design a document type that matches the WS-Security token you need to include (start with username token since its simple).
- Use a map step to populate the variables in a doc type (typically username, password, creation timestamp and nonce)
- If needed, Add code to create the password digest using the very specific algorithm called out in the WS-Security Basic Profile documentation (typically involves base64-encoding and creation of a sha-1 digest)
- Convert the doc type instance to an XML string taking care to use namespace prefixes associated with the correct namespaces in nsDecls parameter
- Convert the XML string to a node
- Add the node to your soap request header using the built-in service for this
A tool like SoapUI will auto-magically add a variety of ws-security tokens to test cases giving you a good example to follow. Download the free version of SoapUI 2.5 and read up on the help for WS-Security outbound configurations.
Mark
#webMethods#API-Management#soa