Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Apache HTTPClient UnAuthorized Issue

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a Restful Webservices client using https. Here are the steps I follow....

a) I create a HTTPClient, set the NameValuePair with action, username, password tokens as j_security_check, j_username, j_password for authentication. I create the PostMethod and make the authentication call.
b) Server authenticates successfully and I get back statuscode = 200.
c) Now, I releaseConnection PostMethod, and create a new PostMethod for the second request, but with the same authenticated HTTPClient object.
d) Second postmethod is the actual restful webservice call for the data.

Now, second call successfully works and returns correct results when there is only one server running on the webservices provider end. But, when the provider brings up two servers, then the second call returns unauthorized or it fails at the first call itself returning statuscode = 400.

I am thinking the provider has some load balancer running before the two servers. So, I need some kind of sticky session at the load balancer so that the second is routed to the same server as the first. Is this correct? Or Am I goofing up somewhere in my HTTP Client code.

I would really appreciate any clues to resolve this issue. Also, I posted the same issue here as well http://goo.gl/vFf4

Thank you.
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic