Please forgive me if made any mistake with this post (first timer)
Straight into the issue
We got a wsdl file from a 3rd party, threw it into Eclipse to create the stubs with Axis2-1.4.1, finished writing the client, works great from our office.
Deployed the Webservice client (stubs included) on the Client side, then issues started because The client's WWW connection is done via a proxy (NTLM).
I wrote a normal/direct http connection jsp which after having to upgrade the jdk version, and using the "java.net.Authenticator.setDefault(myAuthenticator)" connects to the WWW just fine. so i started celebrating and all, until i decided to test the Webservice itself.
The code snippet for the jsp:
The code snippet for the Webservice client:
And that's where all breaks loose with the following exception:
After i noticed that the Webservice was always just somehow defaulting to BASIC, did a tcp dump to look at all the differences between the two connections:
Direct (not webservice)
I've seen that the warning
is given in HttpMethodDirector.java in method authenticateHost(final HttpMethod method)
Required credentials not available for BASIC
and that method has the following:
is taken from the
which I would guess is "supposed" to be getting these details within HttpMethodDirector.java:
I have no idea why this thing is still defaulting to BASIC.
What am i doing wrong with the webservice client?
Thanks in Advance
try this post http://wso2.org/library/161
Thanks for the response, i'm currently out of ideas on this one (still trying to find a way but also started thinking of an alternative way to Axis for doing the webservice).
But still hoping someone will come with a solution.
Just thought someone out there would have had to do Axis via ntlm proxy before.
Please let me know if you have a light bulb moment
Did you find the solution for this problem. I had similar problem but not able to find solution from many days. Also you mentioned that with old version of java and from your office you were able to get authenticated. Can you share that code.
I want to invoke a webservice on sharepoint with NTLM authentication, i don't have aproxy in between. please suggest.
Did you find the solution for this problem
Unfortunately, NO, I ditched the whole Axis idea.
I decided that since a webservice is just an xml over http at the end of the day, to write the xml myself (created a skeleton file),
fill it up using DomParser, messed around with the http request headers to make sure they adhered to the spec,
so i'm doing the whole thing as in jsp example i put in the first post, using Authenticator
and those guys that sit in those financial&projects meetings in their fancy suites stopped pointing fingers at me...
so i guess that means it's working just fine
Also you mentioned that with old version of java and from your office you were able to get authenticated. Can you share that code.
I want to invoke a webservice on sharepoint with NTLM authentication
Slight misunderstanding there, from the office, we were connecting directly to the EndPoint without having to deal with any authentication.
The authentication stuff started on the client side, who uses a proxy for their web connections, and the proxy just happened to be using NTLM,
so we were forced to do the NTLM authentication to get past the proxy.
Ooooh! I just found the link that might have an answer to your specific problem:
That guy seems to also be using NTLM for consuming a sharepoint webservice
Let us know how it goes