Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting HTTP Headers from SOAP Response  RSS feed

 
sethuraman sukumaran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our project, from one of our applications, we need to call a 3 rd party tool which exposes its methods as webservice (document style).

First we need to call one of the operations, LogIn which I could call successfully and get the response.

But I am unable to make subsequent call to other methods which they expose. When contacted the tool administrators, I was told that they send the Cookie back which I need to set it in the HTTP Header before making any subsequent call.

My question is, is there a way to get the HTTP Headers from the SOAPEnvelope which is the return type of call.invoke(...).
I am using AXIS 1.2.

Any help will be greatly appreciated as we are in the crunch situation in delivering the project.

Thanks & Regards,
Sethu.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this one.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That article has a ColdFusion slant; the Java way to do it might be something like

Or maybe HEADER_COOKIE2, I'm not sure what the difference is.
 
sethuraman sukumaran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ppl for your response.

Actually, I missed "call.setMaintainSession(true);" before making a webservice call. By default its false and hence it didn't attached the response headers / cookies while making subsequent calls.

Thanks again...
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great you got it working.
You may however want to gently suggest to your tool provider that in a future version that type of information should be provided in a SOAP Header, not in an HTTP header.

For some background see
Lost Session at JWSP-Client.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!