The service exists and the web-service client works fine from my local machine(uses my local credentials for NTLM authentication), however when I run it from Linux box it fails which tells me that there is something wrong that I might need to fix in my authentication code.
If I remove the authentication code completely, then I get the old-school 401 unauthorized error, however when I uncomment that code, 401 ERROR goes away and I get "Server redirected too many times" error. I am having hard-time figuring out this error.
My sharepoint web-service owner says it has certainly to do with authorization...but I am not quite sure about it.
Chintan B Shah
Joined: Sep 23, 2008
It seemed to be NTLM authentication issue rather than web-service one.
So, all is good now.
Just to share it with everyone for NTLM authentication, you can use Authenticator.setDefault method and user name needs to be passed in following format:
"domainName\\userName" - where DomainName stands for the name where you want the user authentication to happen(I confused this with domain name of resource URL which I was trying to access).
e.g. If I am a user on "aaa.corp.aa.com" and needs to access intranet URL "http://yyy.com", then domainName to be used in code should be "aaa.corp.aa.com\\userName" and not "yyy.com\\userName".