Application Programming Interface Guide > Built-in Procedures > Procedures Reference > AddUsernameToken
 
AddUsernameToken
Add a WS-Security UsernameToken to a SOAP envelope.
The UsernameToken is added to the SOAP header that is identified by the actor and mustUnderstand arguments. If the SOAP message does not contain a SOAP header with the specified actor and mustUnderstand values, the header is created.
The passwordType argument (DIGEST (default) or TEXT) determines how the password is encoded in the UsernameToken.
For details on WS-Security UsernameTokens, see:
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0.pdf
This procedure is discussed in the “Adding a Username Token Pipeline Step” section of the TDV User Guide.
Location
/lib/services/
Inputs
envelope: A SOAP envelope, which may include a WS Security header.
actor: Determines which WS Security header to process. May be NULL.
mustUnderstand: Indicate whether or not the receiver must understand this header. It may be NULL. If NULL, mustUnderstand defaults to TRUE.
username: The username.
password: The user’s password.
passwordType: The password type. Must be TEXT or DIGEST.
Outputs
envelope: The SOAP envelope.
Exceptions
IllegalArgumentException: If any of the arguments are invalid.