We are implementing REST web services in IS 9.5. We have created REST service wherein we are using pub.client.http service to make a call to backend system which is JBOSS server. The JBOSS server will return few fields in response headers, “Cookie” is one among them. We are able to receive all the header fields returned by JBOSS server in http “header/lines” documnet in flow service except the “Cookie” field. We can able to see the Cookie value in server log but not in http service “header/lines” document in flow service. Please suggest on how to get cookie value returned from JBOSS Server in the flow service.
Thanks in Advance.
You are acting as a client, so in the response, you will not get Cookie header field, instead, you should get Set-Cookie header field. And it should be under header/lines.
BTW, Set-Cookie won’t show up every time you call.
If the client (your IS) is presenting a valid cookie in the request, the corresponding session will be used, so you will see Set-Cookie only when a new session is create after the old one expires.
I am not seeing “Set-Cookie” field under header/lines (even thought it is passed by backend in response headers)
In the request we are not passing cookie value. We are passing only parameters (like username and password). The backend system is returning Cookie as “Set-Cookie” field in response headers. But we are not seeing that under header/lines(in flow service).
Can you suggest on this please ?
Which version of WM are you running?
I tested in 8.0 and 9.8, both will show the Set-Cookie under header/lines.
Again, it normally will only show up when a new session is created. The 2nd time you run it, since the cookie is already set, it won’t show.
As per the initial thread start indicates they are on running on IS 9.5.
Then it should be there.
You can set: newSession parameter to yes, so it will open a new session every time, and the Set-Cookie will be there too.
looked again at your IS server log lines:
the cookie line was shown with status 302
302 is redirecting.
your Set-Cookie may be in the 302, but not necessarily in the 200, depends on how redirect is done.
I guess that’s why you are not seeing the Set-Cookie in your response header.
Yes there are redirects. As per my understanding, webMethods is accepting/acknowledging the cookie. So only one cookie is used in redirects. But we should be able to see the cookie in headers as per documentation which is not happening.
The issue is resolved. We need to provide clear IP and Port details in the pub.http service as below in order to see the cookie in response header.
Thanks for your reply.