Hi Shyam, Apologies for the random "chime-in", but I just happened to be reading your post.
Two things I see: 1. There's some weirdness in the cookies. Namely: "Cookie: null; IIIV3942733078="#BEGMD5#6c627724ce8abab6110397daf85343ca#ENDMD5#121-hoov|1775525|112|45|75|0"; 16024108083778=16024108083778[\r][\n]" Which is almost the same as: "Cookie: IIIV3942733078=#BEGMD5#6c627724ce8abab6110397daf85343ca#ENDMD5#121-hoov|1775525|112|45|75|0[\r][\n]" At least the key value of the cookie is the same, and the former doesn't appear to have been sent in a Set-Cookie header by the server. Perhaps the server is grabbing the wrong cookie? 2. My reading of the log appears to suggest that everything IS actually working. The final GET request for /index2.asp?si=31424108094774 appears to return successfully? I've done some significant work with HttpClient connecting to MS systems (namely Exchange via WebDAV) and have had to go through all sorts of hoops to get it to work. One tool I found invaluable is the TamperData plugin for Firefox. If you are able to access this site successfully from Firefox (assuming MS doesn't bump you out due to browser restriction), TamperData will allow you to see the content of the HTTP headers sent to and fro. I have found this very useful to compare what Firefox is giving/receiving with that of HttpClient. Another "tip" was that I ended up disabling all auto-cookie creation in HttpClient and manually inserted the cookies just as I received them from the server. I found that (in 3.x HttpClient anyway) it was screwing up my cookies and sending back different data to the data it received in the Set-Cookie from the server. In my case it was a parsing but in HttpClient. Not sure if the version you are using has any of these issues. Hope something here is of help. Cheers, Jason. On Mon, Jan 12, 2009 at 11:04 PM, shyam <[email protected]> wrote: > Hi Oleg, > > Thank you very much for your reply. > > I solved the Circular Redirect issue by setting the setFollowRedirect of > HTTPMETHOD to false. > > Now I am able to get the inside page. > > But when I try to get a link in that page, it is redirecting abnormally. > And I am getting the the same index page again and again. > > I think I am setting the Cookies correctly. > Please Help me, I am stuck here. > I am attaching the Wire Log. > > Thanks for reading. > Regards, > Shyam > > -----Original Message----- > From: Oleg Kalnichevski [mailto:[email protected]] > Sent: Saturday, January 10, 2009 6:38 PM > To: HttpClient User Discussion > Subject: Re: CircularRedirectException: Circular redirect to > > shyam wrote: > > Hi All, > > > > > > > > I am trying to execute a Post method to login using Username and Password > to > > a site, using HttpClient. > > > > > > > > I am getting status 301 object moved permanently. > > > > > > > > Then when I try to execute Get method on the Location, It is showing the > > following exception:- > > > > > > > > org.apache.commons.httpclient.CircularRedirectException: Circular > redirect > > to' > > > > > > > > > > > > Can you please tell me why this is happening? > > > > > > Post a complete wire / context log of the session > > http://hc.apache.org/httpclient-3.x/logging.html > > Oleg > > > > > > > How can I correct this? > > > > > > > > Thanks & Regards > > > > > > > > Shyam > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
