Layer7 API Management

  • 1.  Create new message an add cookies from another

    Posted Aug 31, 2018 07:46 AM

    Hi,

     

    I have a problem with a develpment using CA API Gateway 9.2. I've looking in the documentation and forums, but I don't find the solution.

     

    I need to routing a POST call to a backend. Ok, until this point, all is right. Next, with the response, I need to make a GET call to another URL in the same backend. This new call must include the cookies specified in the Set-Cookie obtained from the previous response.

     

    I know that in order to switch from POST to GET, I have to create a new message and specifies in the http routing assertion the GET method with the that new message, but I have not able to add the cookies to the message created with the setContextVariable assertion. I have using "Manage Cookie" assertion and "Manage Transport" assertion, but it seems that the these assertions doesn't actualize the variable.

     

    Any idea about what am I doing wrong?

     

    Thanks and regards,

     

    Jesus



  • 2.  Re: Create new message an add cookies from another
    Best Answer

    Broadcom Employee
    Posted Aug 31, 2018 09:39 AM

    Hi Jesus,

     

    If I am understanding right you just need to add the cookie to the new outgoing request to the backend. If the message body you are sending to the backend system is variablized you can use the 'Manage Cookie' assertion as you mentioned.

     

    Once you set the cookie value(s) you wish to add right click on the assertion and choose 'Select Target Message'. Here you are specify the name of the context variable that contains the message body.

     

    Additionally, you can check that the route assertion is passing through the cookie. There is a setting in the assertion properties (in the Headers tab) to pass through only certain request headers. If this is select and 'cookie' is not included it will not be passed through.

     

    Regards,

    Joe



  • 3.  Re: Create new message an add cookies from another

    Posted Sep 03, 2018 04:58 AM

    Hi Joe,

     

    Thanks for your help. Yes, I implemented the routings as you described, but when I tested it with the debugger implemented in Policy Manager, I dindn't see that the POST method changed. In order to discard a problem with traces, I created a mock service to receive the GET method and I could verify that the method was changed, so it seem works.

     

    Thanks and regards,

     

    Jesus.