aspose file tools*
The moose likes Web Services and the fly likes Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC)" Watch "Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC)" New topic
Author

Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC)

mahlatse makalancheche
Greenhorn

Joined: Jan 27, 2011
Posts: 8
Hi there

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)



Via Axis2



Extra info:
I've seen that the warning
Required credentials not available for BASIC
is given in HttpMethodDirector.java in method authenticateHost(final HttpMethod method)



and that method has the following:


So the
authscheme
is taken from the
method
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?

Please help...

Thanks in Advance



Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Looks like Axis2 has some problems with NTLM incoperated.

try this post http://wso2.org/library/161

Have Fun with Java
little,little.. little by little makes a lot..
mahlatse makalancheche
Greenhorn

Joined: Jan 27, 2011
Posts: 8
Hi Shankar

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
Kunal Sham
Greenhorn

Joined: Apr 30, 2011
Posts: 2
Hi mahlatse,
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.
mahlatse makalancheche
Greenhorn

Joined: Jan 27, 2011
Posts: 8
Hi Kunal

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:
http://www.coderanch.com/t/518873/Web-Services/java/Consume-Sharepoint-Web-Service-inside

That guy seems to also be using NTLM for consuming a sharepoint webservice

Let us know how it goes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC)