I found out what the source of this problem is. HttpClient 3.x throws this error when you try to set redirections on for any POST operations.
It's okay to use redirections for GETs, but unfortunately all SOAP communication will be using POSTs. So that's why I didn't set up redirections for SharePoint or Meridio before. With some hacking, I'm sure we could find a way to make httpclient perform the desired action, but that's outside of the scope of a simple fix. So, the only solution is to figure out why web services access is causing the redirection in the first place. I'm going to check in the code reversion shortly. Karl -----Original Message----- From: Wright Karl (Nokia-S/Cambridge) Sent: Tuesday, May 11, 2010 11:24 AM To: [email protected] Subject: RE: 302 when trying to connect to Sharepoint Well, now it's clear that the SharePoint instance you are connecting to is configured in an unusual way. The axis fault = Server.userException says that the error is coming back from the server. The detail is strange in that it is giving what looks like a Java exception - from the SharePoint server, which is a .NET application. I suggest turning on wire level debugging, so we can see exactly what's going to and from the server. Perhaps the credentials you are giving it are incorrect in some way, and it is trying to redirect you to a logon screen or something - and we'll see all that if we log the back-and-forth of the communication. To turn on wire debugging, edit your logging.ini file (or whatever you called it), and add this line at the end: log4j.logger.httpclient.wire=DEBUG then, restart tomcat, and view the connection again. You should see output in your log file that is related to the SOAP requests going back and forth. If you send those to me, I can interpret them for you. Karl ________________________________________ From: [email protected] [[email protected]] On Behalf Of ext Simon Habtemikael [[email protected]] Sent: Tuesday, May 11, 2010 11:11 AM To: [email protected] Subject: Re: 302 when trying to connect to Sharepoint Tried the new commit and now i get: Got an unknown remote exception accessing site - axis fault = Server.userException, detail = java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention instead. -Simon On Tue, May 11, 2010 at 4:45 PM, <[email protected]<mailto:[email protected]>> wrote: It might. Then again, it might not. Normally, accessing SharePoint via web services does not cause any redirections to occur. But it's possible your SharePoint instance is configured differently. So I suggest that you try it, and if it works for you, then great. It has been committed now. Karl ________________________________________ From: [email protected]<mailto:[email protected]> [[email protected]<mailto:[email protected]>] On Behalf Of ext Simon Habtemikael [[email protected]<mailto:[email protected]>] Sent: Tuesday, May 11, 2010 10:40 AM To: [email protected]<mailto:[email protected]> Subject: Re: 302 when trying to connect to Sharepoint Oh! Will that fix my problem? -Simon On Tue, May 11, 2010 at 4:33 PM, <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> wrote: I have noticed that redirections don't appear to be enabled in CommonsHttpSender, which is unintentional and is a bit of a surprise. I'll be updating the code accordingly. Karl ________________________________________ From: Wright Karl (Nokia-S/Cambridge) Sent: Tuesday, May 11, 2010 10:21 AM To: [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>> Subject: RE: 302 when trying to connect to Sharepoint Hi Simon, I guess there are two ways to pursue this. First is to figure out why you are getting a redirection in the first place. Second would be to figure out why you aren't seeing proper redirection handling from httpclient. First, I'd ask you to verify that you have set up the appropriate wsdd reference in the LCF properties.ini file. Without that reference being correct, axis uses its own transport, not httpclient, and I don't know what exactly it does with redirections. The second thing I'd ask you to do is to log into your root SharePoint site with your browser first, and look at the url after you log in. Are the URL components the same as what you entered for the SharePoint connection? They should be. Karl ________________________________________ From: ext Simon Habtemikael [[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>] Sent: Tuesday, May 11, 2010 10:11 AM To: [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>> Subject: Fwd: 302 when trying to connect to Sharepoint Hi! I set up LCF and created a Authority Connection (AD) and a Repository Connection (Sharepoint) however when I enter all the necessary information, i get the following Connection Status:Unexpected http error code 302 accessing SharePoint at http://win2k8sharepoin/Docs: (302)Found I don't really understand why I keep getting a redirect ? Any idea on how to fix this? Thanks! Best regards, Simon
