4 Replies Latest reply on Jul 11, 2012 7:53 AM by gunnarbos

    jax-ws client for HTTP Digest authentication

    gunnarbos

      Hi,

      I've manage to set up JBoss 7.1.1-final with both HTTP BASIC and DIGEST authentication and it works fine when tesing with SOAPui.

      Now I try with a jax-ws client and it works for BASIC authentication when I put the following lines in my code:



      /* Optional credentials for basic authentication */


      requestContext.put(BindingProvider.USERNAME_PROPERTY, "guest");


      requestContext.put(BindingProvider.PASSWORD_PROPERTY, "pass");

       

      What do I need to do to get DIGEST authentication work?

       

      Thanks

      Gunnar

        • 1. Re: jax-ws client for HTTP Digest authentication
          spyhunter99
          • 2. Re: jax-ws client for HTTP Digest authentication
            gunnarbos

            Hi,

            I use standard java 7 libraries to create the client and the java classes are generated from the wsdl file with mvn org.jvnet.jax-ws-commons:jaxws-maven-plugin, so I don't think that it should depend on JBoss.

            Can you please explain?

            Thanks

            Gunnar

            • 3. Re: jax-ws client for HTTP Digest authentication
              spyhunter99

              JAX-WS is a standardized API. The JDK comes with a reference implementation. I'm not sure if the reference implementation supports digest Jboss includes its own implementation and overrides what's included with the JDK using the endorsed libs. The mechanism of generating the client and service classes has no affect in this case. It's the runtime environment. Since you're posting on a jboss forum, I'm assuming that your targetted environment is in fact jboss.

               

              If you ran outside of jboss, such as with the endpoint api, and didn't specify endorse libs, it would default the reference implementation in the jdk.

               

              So you'll either have to use CXF, or just use http basic, http client cert, or use xml based authentication, such as ws-usernametoken, etc

               

              There should be a feature request on jira about it

              • 4. Re: jax-ws client for HTTP Digest authentication
                gunnarbos

                Hi,

                I wrote in this JBoss forum because, the web service that we have implemented will be processed in JBoss.

                I just tried to make up a client test example to know that we can set up the service both for basic and digest authentication, beacuse this was not decided yet.

                The client shoud also be used for some stress testing.

                As you wrote I used the reference implementation in JRE 7 and expected it to have support for both basic and digest authentication.

                I've googled for an answer but not found it, so I tried this forum.

                Thanks

                Gunnar