2 Replies Latest reply on Oct 17, 2005 9:24 AM by Mike Anderson

    how to obtain username of caller for a web service that is a

    Mike Anderson Newbie

      I have deployed a POJO as a web service and am using BASIC http authentication. I am using the DatabaseServerLoginModule to validate the security credentials of the caller.

      Is there a way to obtain the caller (username) in the POJO web service? I would like to be able to store a record in the database of who performed specific web service operations.

      For instance, if the method I exposed as a web service is

      public class SubmitSMSImpl
      {
       public String saySomething(String something){
       System.out.println(name);
       //Get caller name here and store in database if possible
       return something;
       }
      }


      How would I get the name of the caller who was authenticated in this method? Is it only possible to obtain caller information if the web service is a session bean instead of a POJO?