RE: http authentication with Axis2

2007-03-20 Thread Kin Onn Low
Here's the code I'm using :

ArrayList authSchemes = new ArrayList();
authSchemes.add(HttpTransportProperties.Authenticator.BASIC);

HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();

auth.setPreemptiveAuthentication(true);
auth.setAuthSchemes(authSchemes);
auth.setUsername(username); 
auth.setPassword(password);

client.getOptions().setProperty(HTTPConstants.AUTHENTICATE,
auth);   

where client is the OperationClient instance.  Hope this helps.



-Original Message-
From: pat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 21, 2007 4:57 AM
To: axis-user
Subject: http authentication with Axis2

Hello,

I'm fighting with http authentication in Axis2 in the generated code
with
XMLBeans. I've set up Tomcat's realms and updated the Axis2 web.xml by
adding
this:

 admin-constraint
 
  
  axis2admin
 


 admin-role
 axis2admin


Then I followed the Axis2 documentation:
Options options = new Options();
HttpTransportProperties.Authenticator auth = ...;
auth.setUsername("username");
auth.setPassword("password");
options.setProperty(HTTPConstants.BASIC_AUTHENTICATE,auth);

... and I'm cofused :-(

The "BASIC_AUTHENTICATE" doesn't exist in the class, so I've used the
"AUTHENTICATE" as:
options.setProperty(HTTPConstants.AUTHENTICATE,auth);

I want to use generated stub as follows:
TestStub stub = new TestStub(ConfigurationContext, String);

I expect the connection has to be configured with ConfigurationContext
instance, but which properties and how to be set to it?

Can comeone sent me a example which describes the ConfigurationContext
instance setup?

Thanks a lot.

 Pat

P.S. Yes I've googled a lot but without luck :-(

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http authentication with Axis2

2007-03-20 Thread Jarek Kucypera

pat wrote:

In case of axis2 1.1.1 this should help:
auth.setPreemptiveAuthentication(true);

The lack of documentation is disappointing , isn't it ...?

J.K.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]