Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
nightly
-
None
-
None
-
Any
Description
This has been reported by Jonathan McCracken (jon@nexicon.ca)
===========================================
Hello Samindaa,
First off thank you for contributing to Axis2, and I hope you have the
time to respond to my question regarding getting NTLM working for my
Client Stub in 1.1 release.
I've looked through all the articles I can find and have turned up
with the same error. I'm using the following code to modify my stub:
public AdminWebServiceStub() throws org.apache.axis2.AxisFault {
populateAxisService();
populateFaults();
ConfigurationContext configurationContext = null;
_serviceClient = new
org.apache.axis2.client.ServiceClient(configurationContext,_service);
configurationContext =
_serviceClient.getServiceContext().getConfigurationContext();
//setup NTLM auth
HttpTransportProperties.Authenticator
auth = new
HttpTransportProperties.Authenticator();
auth.setDomain("domain");
auth.setUsername("username");
auth.setPassword("password");
//do not set HOST or PORT...although I've tried this and both return
same error //auth.setHost("url");
//auth.setPort(83));
//NTLMScheme ntlmAuthScheme = new NTLMScheme();
//ArrayList authSchemes = new ArrayList();
//authSchemes.add(ntlmAuthScheme);
//auth.setAuthSchemes(authSchemes);
//set NTLM auth
_serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
auth);
//set webservice end-point
_serviceClient.getOptions().setTo(new
org.apache.axis2.addressing.EndpointReference("url"));
//Set the soap version
_serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI );
}
/////////////END CODE
The error I get is as follows:
Jan 2, 2007 3:07:15 PM
org.apache.commons.httpclient.HttpMethodDirector
processWWWAuthChallenge
WARNING: Unable to respond to any of these challenges:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' - 'Unauthorized'
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:670)
at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisOperation.java:365)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295)
at com.transcanada.safex.externalAccess.tedsProxy.AdminWebServiceStub.GetUser (AdminWebServiceStub.java:622)
at com.transcanada.safex.junit.TestTedsBindingStub.testGetUser(TestTedsBindingStub.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main (JUnitStarter.java:31)
Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' - 'Unauthorized'
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:340)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java :205)
... 23 more
Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'
at org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java :144)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:334)
... 24 more
/////////END STACK TRACE
I'm not sure what I'm doing wrong, as far as I can tell my client has
the correct HTTPTransportProperties at runtime (i've debugged this one
a few times). I've also checked the credentials and they work, but the
error seems to be related to not being able to respond to the NTLM
Negotiate challenge?
Any help/ideas would be greatly appreciated.
Thanks,
Jonathan
===========================================
The problem is in AbstractHttpSender