• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.xml.ws.WebServiceException: Failed to access the WSDL file and Server redirected too many time

 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to access Sharepoint web-service and I am also specifying HTTP Authentication using below code



Above code is called right before


I get the below error message when I deploy it on one our servers.

java.lang.Exception: Error: javax.xml.ws.WebServiceException:
Failed to access the WSDL at: http://sharepoint.<companyname>.com/na/network/_vti_bin/lists.asmx?WSDL. It failed with:
Server redirected too many times (20).


Any help is appreciated.

Regards,
Chintan.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since that is a server side problem you should be talking to the owner of the web service.

Perhaps the service has been moved and you need a better address.

Bill
 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bill,

Perhaps I should have been more clear.

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.

Thanks
Chintan.
 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

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".

This link provides more info
http://download.oracle.com/javase/6/docs/technotes/guides/net/http-auth.html.

In my case I did not have to do " -Dhttp.auth.preference="scheme" ", since there were 3 authentication schemes setup on Sharepoint Server...and if 1 failed it checked with second one and so on..

HTH.

Thanks
Chintan.
 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a good example.

http://www.muneebahmad.com/index.php/archives/127

Thanks
Chintan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic