Win a copy of The Business Blockchain this week in the Cloud forum!
    Bookmark Topic Watch Topic
  • New Topic

Getting HTTP Headers from SOAP Response

 
sethuraman sukumaran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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(...).

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

Thanks & Regards,
Sethu.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello "sethuraman s"-

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

Also, please don't post the same question to multiple forums. It wastes peoples time if multiple redundant conversations take place at the same time. Let's continue the discussion in the duplicate post here
 
Nikhil Goel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Report post to moderator
What they would be meaning is that after calling login Web Service call.invoke() is returning a cookie as output message from Web Service . You need to grab that like
String cookie = (String) call.invoke(actualArgs for the login web service);
System.out.println("cookie= " + cookie);


You need to see what app server you are working with as HttpServletRequest has only 2 methods getHeaderNames() that returns an enumeration and other one getHeader(<<header name).

So the soln is
1)Get the cookie as explained above
2)Ask the administrator under what header value they want this cookie value to be set.
3)Also look into the API of App/Web Server they might have given some HttpHeader class that you need to call some setter() on that class to set the header name and value(cookie).
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is a duplicate thread. Please reply instead in this thread.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic