• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like Axis2 has some problems with NTLM incoperated.

try this post http://wso2.org/library/161
 
mahlatse makalancheche
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
https://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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic