Thanks Oleg. I was thinking about this, but again HttpState is not serializable. So I thought again not going to the wrong direction, I will better ask the Guru's.
Thanks for the help! Best Regards Jugs -----Original Message----- From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 09, 2007 5:58 PM To: HttpClient User Discussion Subject: Re: Serializing HTTPClient On Tue, 2007-01-09 at 17:26 +0530, Jagadeesh wrote: > Hi All, > > > > I have a pretty unique problem where I need to serialize the HTTPClient > object. In my application I have to access an API server which uses REST > protocol and I have to maintain the session for each and every user. So I > kept the HTTPClient object in the HTTP session and now when I am trying to > use load-balancing and clustering, as expected I am running into problems > with serializing the HTTPClient object which is stored in the HTTP session. > > > > I would like to know whether there are any workarounds to fix this. > Jagadeesh, There is no point to serialize the whole damn thing. HttpClient keeps all its state in a single instance of HttpState class. Just extend the HttpState class, make it implement Serializable and pass an instance of this class to HttpClient along with the request to be executed. Re-use stateless instance(s) of HttpCkient as you see fit. Hope this helps Oleg > > > Thanks > > Jugs > --------------------------------------------------------------------- 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]
