3 Replies Latest reply: Oct 5, 2012 8:53 AM by jtahlborn RSS

    HTTP Authentification for Web service server

    mycoffee
      I built the WS using JAX WS, and it works fine.
      Calling WS from the client side, I can set the BasicHTTPAuthenticator
      Authenticator.setDefault(new BasicHTTPAuthenticator(adminID, adminPW));    
                     
                     RequestWSService reqWSServ = new RequestWSService(new URL(url));
                     RequestWS reqWS = reqWSServ.getRequestWS();
                     Request request = new Request();
                     request.setAny(doc.getDocumentElement()); 
                     Response response = new Response();               
                     response = reqWS.request("sync", request); 
      But in the server side, how can I get the Authenticator back to check user and password
      I found the application authentication, but not http-authentication
      http://www.mkyong.com/webservices/jax-ws/application-authentication-with-jax-ws/
      Thank for your help

      My WS will run on tomcat, geronimo and websphere

      Edited by: mycoffee on Oct 4, 2012 1:14 PM
        • 1. Re: HTTP Authentification for Web service server
          836548
          But in the server side, how can I get the Authenticator back to check user and password
          I found the application authentication, but not http-authentication
          What do you mean by http-authentication?

          generally it is only mode of passing user credentials to validate before accessing the main service in the webservice. Hence your web service should have a code to check the credentials.
          • 2. Re: HTTP Authentification for Web service server
            mycoffee
            833545 wrote:
            But in the server side, how can I get the Authenticator back to check user and password
            I found the application authentication, but not http-authentication
            What do you mean by http-authentication?

            generally it is only mode of passing user credentials to validate before accessing the main service in the webservice. Hence your web service should have a code to check the credentials.
            My problem is how can I get the user id and password from the server. when user sent it using the code above
            • 3. Re: HTTP Authentification for Web service server
              jtahlborn
              This tutorial is probably a good place to start:

              http://docs.oracle.com/cd/E19226-01/820-7627/bnccv/index.html