Re: HTTP Authorization Header

2007-03-02 Thread Jarek Kucypera

Thomas michelbach wrote:


Hi,
 
I'm trying to pass the Authorization header via HTTP.

Is there a way to do that?


Yes there is, set this flag in the authenticator:

auth.setPreemptiveAuthentication(true);

J.K.



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



AW: HTTP Authorization Header

2007-03-01 Thread Steinberg Martin
Hi Thomas,

 

I had the same problem. I use the following code - and it rocks ;-))

 

WebServiceStub.java (Constructor)

 

   _serviceClient = new
org.apache.axis2.client.ServiceClient(configurationContext,_service);



configurationContext =
_serviceClient.getServiceContext().getConfigurationContext();

 

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

auth.setUsername("user");

auth.setPassword("pass");

Options options = _serviceClient.getOptions();

options.setProperty(HTTPConstants.AUTHENTICATE, auth);

_serviceClient.setOptions(options);

_serviceClient.getOptions().setTo(new
org.apache.axis2.addressing.EndpointReference(

targetEndpoint));

 

 

 

 

 

 

 

Hi,

 

I'm trying to pass the Authorization header via HTTP.

 

Im using axis2 1.1.1 and trying to set the options like that

 

HttpTransportProperties.Authenticator auth = 

new HttpTransportProperties.Authenticator();
auth.setUsername(username); 
auth.setPassword(password);
options.setProperty(HttpTransportProperties.Authenticator. BASIC, auth);


My TPCmon is logging the information for me and axis does not send the
HTTP header for authorization (Base 64 encoded). 

Is there a way to do that? 


I only get following these header fields:

 

SOAPAction: "urn:anonOutInOp"
User-Agent: Axis2
Host: localhost:5554
Content-Length: 453
Content-Type: text/xml; charset=UTF-8

 

Bye and Thanks
-- 
Thomas Michelbach 



HTTP Authorization Header

2007-03-01 Thread Thomas michelbach

Hi,

I'm trying to pass the Authorization header via HTTP.

Im using axis2 1.1.1 and trying to set the options like that


HttpTransportProperties.Authenticator auth = *new*
HttpTransportProperties.Authenticator();
auth.setUsername(username);
auth.setPassword(password);
options.setProperty(HttpTransportProperties.Authenticator.*BASIC*, auth);

My TPCmon is logging the information for me and axis does not send the HTTP
header for authorization (Base 64 encoded).
Is there a way to do that?
I only get following these header fields:

SOAPAction: "urn:anonOutInOp"
User-Agent: Axis2
Host: localhost:5554
Content-Length: 453
Content-Type: text/xml; charset=UTF-8

Bye and Thanks
--
Thomas Michelbach