Layer7 API Management

Expand all | Collapse all

Is there a way to identify the context variable for the body part of "Return Template Response to Requestor" assertion?

  • 1.  Is there a way to identify the context variable for the body part of "Return Template Response to Requestor" assertion?

    Posted Jun 03, 2016 01:44 PM


    I've used quite a lot of 'Evaluate Response XPath ' assertions to target only certain XML elements and stored them into their own context variables. I then used these context variables and arranged them as output for my response using 'Return Template Response to Requestor' along with a root XML element tag.

     

     

    Depending on my IF-ELSE conditions of my policy, the response output varies. I may sound silly as I am a beginner. But is there a way to find out the context variable of these response templates? I've already tried the 'lookup context variables' assertion.

     

    I've attached a snapshot of a section of my policy and the template response property window



  • 2.  Re: Is there a way to identify the context variable for the body part of "Return Template Response to Requestor" assertion?

    Posted Jun 03, 2016 04:36 PM

    If you right-click an assertion in the Policy Manager and select 'View Info', you will see any Context Variables associated with an assertion. Here is what it shows for the Return Template Response assertion:

    As you can see, there are no Context Variables directly associated with that assertion.

     

    I'm not totally sure if that's what you are asking for here though. Are you looking to see the actual complete response that will go back to the user of the API? You can add an 'Audit Messages in Policy' assertion and set 'Save response' to 'Always' to have it show up in the Audit log.



  • 3.  Re: Is there a way to identify the context variable for the body part of "Return Template Response to Requestor" assertion?
    Best Answer

    Posted Jun 03, 2016 05:16 PM

    Instead of building your response message in the Return Template Response to Requestor assertion itself, you could build it in another context variable that you then use in the Return Template Response to Requestor assertion.