Class Credentials

java.lang.Object
com.ptc.jws.client.handler.Credentials

public class Credentials extends Object

This class is a generic holder for username and password that are being programmatically supplied by web service client source code. This independent class is used to keep client code more consistent regardless of the corresponding service's security policy. Supplied WSIT and JAX-WS callback handlers that gather client credentials will look to this class to see if credentials have been supplied.

This class makes use of the system properties wt.webservice.user and wt.webservice.password to supply system wide credential values (optional). The setUsername/Password methods specify thread specific credentials which will over-ride any values specified on system properties. If both are null then most handling classes will prompt the user for credentials.



Supported API: true

Extendable: false
  • Method Details

    • setUsername

      public static void setUsername(String user)
      Sets the current thread's username for web service calls.

      Supported API: true
      Parameters:
      user - The username.
    • setPassword

      public static void setPassword(String pass)
      Sets the current thread's password, if necessary, for web service calls.

      Supported API: true
      Parameters:
      pass - The password.
    • clearUsername

      public static void clearUsername()
      Clears this thread's username for web service calls.

      Supported API: true
    • clearPassword

      public static void clearPassword()
      Clears this thread's password for web service calls.

      Supported API: true