Hi,
 
I am using Axis 2 to communicate with a server which has ntlm authentication. 
When I am invoking web service methods which do not involve any attachment, it 
is working fine. Using TCP packet capturing, I can even see the NTLM 
authentication happening via challenge/response handshaking. One problem that I 
see here is that for every method invocation the ntlm authentication is 
occuring which is a kind of redundancy. I think this is happening because 
pre-authentication feature is not built into Axis 2 or common httpclient. 
 
But the more serious problem is  happening when I am trying to post data as 
attachment. The entire SOAP request is sent as a multipart MIME-encoded 
request. The first part is the SOAP envelope, and the second part is the 
attachment. But as it seems to me the ntlm authentication handshaking is 
getting into way and the client is not responding accordingly and is continuing 
with its multipart post. I am using Axis 2-1.1.1 version. The authentication 
code used is like below:
 
      HttpTransportProperties.Authenticator auth = new 
HttpTransportProperties.Authenticator();   auth.setUsername("Admin");   
auth.setPassword("<password>");   auth.setRealm("");   auth.setDomain("");   
auth.setHost("<ip-addr>");   auth.setPort(80);         
options.setProperty(HTTPConstants.AUTHENTICATE, auth);   
options.setProperty(HTTPConstants.HEADER_CONNECTION_KEEPALIVE,Constants.VALUE_TRUE);
   options.setTo(targetEPR);       
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);      
options.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);  
 options.setProperty(Constants.Configuration.CONTENT_TYPE, 
Constants.BASE_64_CONTENT_QNAME);      ServiceClient servClient = new 
ServiceClient();   servClient.setOptions(options);      OMElement result = 
servClient.sendReceive(method);  
 I am new to Axis and authentication. Any suggestion would be of great help. 
_________________________________________________________________
Windows Live Spaces is here! It’s easy to create your own personal Web site.
http://spaces.live.com/?mkt=en-in

Reply via email to