If you need a way to do this in Axis2 1.0 release, please see
http://www.wso2.net/2006/05/reuse_share_http_connections

It shows you how to set up a MultiThreadedHttpConnectionManager, you
can set one up with basic preemptive just like in saminda's patch.

thanks,
dims

On 5/11/06, Saminda Abeyruwan <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Saminda Abeyruwan wrote:
> Lothar Nieswandt wrote:
>
>>>Hello all,
>>>
>>>I am trying to write a *simple* web service client with axis2. The server
>>>side requires http basic authentication. I can't find out how this is done
>>>*easily* with axis2. Somebody on the list advised to do
>>>
>>>call.setProperty(Call.USERNAME_PROPERTY, "user");
>>>call.setProperty(Call.PASSWORD_PROPERTY, "pass");
>>>
>>>but this seems to be deprecated. What is the proper way of doing this?
>>>
>>>I took a look at the security example and read something about password
>>>callbacks but that seemed too complicated.
>>>
>>>Any hints?
>>>
>>>Thanks in advance,
>>>Lothar
>>>
>
>
> Hi Lothar,
>
> Axis2 does transport level basic authentication as follows.
> ///// code snipet
>
> OMElement payload = TestingUtils.createDummyOMElement();
>         /**
>          * Proxy setting in runtime
>          */
>         HttpTransportProperties.ProxyProperties proxyproperties = new
>   HttpTransportProperties().new ProxyProperties();
>         proxyproperties.setProxyName("localhost");
>         proxyproperties.setProxyPort(5555);
>         proxyproperties.setDomain("domain");
>         proxyproperties.setPassWord("password");
>         proxyproperties.setUserName("userName");
>
>         Options options = new Options();
>         options.setProperty(HTTPConstants.PROXY, proxyproperties);
>         options.setTo(targetEPR);
>         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>         ConfigurationContext configContext =
>
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
>                        null, null);
>         ServiceClient sender = new ServiceClient(configContext, null);
>         sender.setOptions(options);
>
>         OMElement result = sender.sendReceive(payload);
>
>         TestingUtils.campareWithCreatedOMElement(result);
>
> For more information please see the test case,
> 
http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=markup
>
> documentation,
> http://ws.apache.org/axis2/1_0/http-transport.html
>
> Thank you
>
> Saminda
>
>

Hi Lothar,

Sorry for misinterpretation. In Axis2 1.0 we do proxy authentication.
For http server authentication we'll have to do a little fix.
I'll attend to this asap.

Saminda
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEYyosYmklbLuW6wYRApboAKCaabIDQ3Cp0U8h6z3veLDMUmf+fgCeKFiq
Ds0w76N+/ESLM0TTUOANYcE=
=0rfH
-----END PGP SIGNATURE-----



--
Davanum Srinivas : http://wso2.com/blogs/

Reply via email to