IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Unable to get Cookie info in response headers

  • 1.  Unable to get Cookie info in response headers

    Posted Mon July 13, 2015 10:33 AM

    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.
    Regards,
    Jacob B



    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Unable to get Cookie info in response headers

    Posted Tue July 14, 2015 06:43 PM

    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.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Unable to get Cookie info in response headers

    Posted Tue July 14, 2015 07:08 PM

    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.


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 04:12 AM

    Hi Tong,

    1. I am not seeing “Set-Cookie” field under header/lines (even thought it is passed by backend in response headers)

    2. 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 ?

    Regards,
    Jacob B


    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 04:01 PM

    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.


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 04:56 PM

    Tong wang,

    As per the initial thread start indicates they are on running on IS 9.5.

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 05:52 PM

    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.


    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 06:25 PM

    Hi tong

    1. We are not setting the cookie in IS instead we are passing the cooking returned by backend.
    2. We have tried by setting new session as yes but we could not see the cookie in header. As per my understanding setting the new session as yes will return new cookie when we are setting the cookie in webMethods.

    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: Unable to get Cookie info in response headers

    Posted Wed July 15, 2015 06:46 PM

    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.


    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Unable to get Cookie info in response headers

    Posted Thu July 16, 2015 01:20 PM

    Hi Tong,
    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.


    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Unable to get Cookie info in response headers

    Posted Fri November 20, 2015 06:40 AM

    Hi Tong,

    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.

    http://testserver:80/

    Thanks for your reply.

    Regards


    #Integration-Server-and-ESB
    #webMethods