axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew B <>
Subject Re: [Axis2]getting username and password
Date Thu, 22 Jun 2006 15:00:13 GMT

I set the username and password on the SOAPBindingStub on the client side (with Axis 1) like

clientStub.setUsername( .... );

I thought this was HTTP Basic authentication. But, when I do the following, per your suggestion:

        HttpServletRequest request = (HttpServletRequest)incomingContext.getProperty(Constants.HTTP_SERVLET_REQUEST);
        String auth = (String) request.getHeader(HTTPConstants.HEADER_AUTHORIZATION);

the string I get back is:


which does not contain the username and password. Either I am  doing something wrong, or clientStub.setUsername()
is not HTTP Basic authentication.



Davanum Srinivas <> wrote: Andrew,

Are u talking about HTTP Basic authentication? You can access the
HttpServletRequest as follows:

HttpServletRequest request = (HttpServletRequest)

Then use:
String auth = (String) request.getHeader(HTTPConstants.HEADER_AUTHORIZATION)

to get the http header for authorization. You can then parse out the
user id and password as shown here [1]

-- dims


On 6/21/06, Andrew B  wrote:
> Hi,
> Does anyone know how to get the username and password that were set on the
> client stub, in the service implementation class? This is another thing that
> was easy in Axis 1 but so far seems to be impossible in Axis 2. I need them
> to do authentication.
> Thanks,
> Andrew B
>  ________________________________
> Want to be your own boss? Learn how on Yahoo! Small Business.

Davanum Srinivas :

To unsubscribe, e-mail:
For additional commands, e-mail:

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
View raw message