You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Nicolas Raoul <ni...@gmail.com> on 2009/09/11 09:01:29 UTC

HTTP Authentication with Axis 1.4

Hello all,

I use an existing Web Service that requires HTTP authentication.
I spent hours today trying to find the official way to set the
username and password, and I could not find any documentation, so I
did some reverse-engineering of the Axis2-generated classes and came
up with this code:

String url = "http://admin:pass@example.com/service"
return new WeatherProxy(url).getTemperature();

Please note the "admin:pass" in the URL.
Is it the supported way to do HTTP authentication with Axis 1.4?

While searching on the Web, I have seen a lot of different Java
methods about setting the user and password, but none of these methods
were to be found in the classes wsdl2java generated (Axis 1.4 via
Eclipse) :
- Weather.java
- WeatherProxy.java
- WeatherService.java
- WeatherServiceLocator.java
- WeatherSoapBindingStub.java
- and classes for each method and type declared in the WSDL

Thank you very much!
Nicolas Raoul
http://nicolas-raoul.blogspot.com

Re: HTTP Authentication with Axis 1.4

Posted by Prabath Siriwardena <pr...@wso2.com>.
I guess you need basic auth. Please have a look at [1].

Thanks & regards.
-Prabath

[1]:http://blog.rampartfaq.com/2009/08/how-to-secure-web-services-with-http.html

Nicolas Raoul wrote:
> Hello all,
>
> I use an existing Web Service that requires HTTP authentication.
> I spent hours today trying to find the official way to set the
> username and password, and I could not find any documentation, so I
> did some reverse-engineering of the Axis2-generated classes and came
> up with this code:
>
> String url = "http://admin:pass@example.com/service"
> return new WeatherProxy(url).getTemperature();
>
> Please note the "admin:pass" in the URL.
> Is it the supported way to do HTTP authentication with Axis 1.4?
>
> While searching on the Web, I have seen a lot of different Java
> methods about setting the user and password, but none of these methods
> were to be found in the classes wsdl2java generated (Axis 1.4 via
> Eclipse) :
> - Weather.java
> - WeatherProxy.java
> - WeatherService.java
> - WeatherServiceLocator.java
> - WeatherSoapBindingStub.java
> - and classes for each method and type declared in the WSDL
>
> Thank you very much!
> Nicolas Raoul
> http://nicolas-raoul.blogspot.com
>
>