Class WSSAddUsernameToken


  • public class WSSAddUsernameToken
    extends WSBaseMessage
    Builds a WS UsernameToken and inserts it into the SOAP Envelope. Refer to the WS specification, UsernameToken profile
    Author:
    Werner Dittmann (Werner.Dittmann@siemens.com).
    • Constructor Detail

      • WSSAddUsernameToken

        public WSSAddUsernameToken()
        Deprecated.
        Constructor.
      • WSSAddUsernameToken

        public WSSAddUsernameToken​(java.lang.String actor)
        Deprecated.
        replaced by WSSecUsernameToken() and WSSecHeader for actor specification.
        Constructor.

        Parameters:
        actor - the name of the actor of the wsse:Security header
      • WSSAddUsernameToken

        public WSSAddUsernameToken​(java.lang.String actor,
                                   boolean mu)
        Deprecated.
        replaced by WSSecUsernameToken() and WSSecHeader for actor and mustunderstand specification.
        Constructor.

        Parameters:
        actor - The name of the actor of the wsse:Security header
        mu - Set mustUnderstand to true or false
    • Method Detail

      • addNonce

        public void addNonce​(org.w3c.dom.Document doc)
        Deprecated.
        Creates and adds a Nonce element to the UsernameToken.
      • addCreated

        public void addCreated​(org.w3c.dom.Document doc)
        Deprecated.
        Creates and adds a Created element to the UsernameToken.
      • setId

        public void setId​(java.lang.String id)
        Deprecated.
        no replacement, id is created by default in WSSecUsernameToken
        set the id
        Parameters:
        id -
      • getSecretKey

        public byte[] getSecretKey()
        Deprecated.
        Get a secret key derived from values in UsernameToken.
        Returns:
      • preSetUsernameToken

        public org.w3c.dom.Document preSetUsernameToken​(org.w3c.dom.Document doc,
                                                        java.lang.String username,
                                                        java.lang.String password)
      • build

        public org.w3c.dom.Document build​(org.w3c.dom.Document doc,
                                          java.lang.String username,
                                          java.lang.String password)
        Adds a new UsernameToken to a soap envelope.

        A complete UsernameToken is constructed and added to the wsse:Security header.

        Parameters:
        doc - The SOAP enevlope as W3C document
        username - The username to set in the UsernameToken
        password - The password of the user
        Returns:
        Document with UsernameToken added