Layer7 API Management

Expand all | Collapse all

Evaluate Response Xpath assertion fail the policy

  • 1.  Evaluate Response Xpath assertion fail the policy

    Posted Nov 27, 2018 04:54 AM

    Hi,

    Here's a sample XML.

    <aaa>

       <bbb>111</bbb>

       <ccc>222</ccc>

    </aaa>

    If this XML contains node <ddd></ddd>, I need to know and show the value.

    The problem is every response XML could contain this node or not.

    I tried to use evaluate response XPath assertion to check the path. (/aaa/ddd)

     

    If the node(ddd) exists, the policy goes smooth.

    If the node(ddd) doesn't exist, the policy will fail.

     

    Is there any way to make the policy continue when the node(ddd) doesn't exist?

     

    Best Regards,



  • 2.  Re: Evaluate Response Xpath assertion fail the policy

    Broadcom Employee
    Posted Nov 27, 2018 10:53 AM

    Hi Gary 

     

    How did you setup the policy ? 

    If you put the Evaluate Response Xpath assertion in a "At least one assertion must evaluate to true" folder

    you can handle the error in the "Evaluate Response Xpath " and continue the policy .

     

    See also the following document .

     

    Thinking in Policy 

     

    Regards 

    Dirk 



  • 3.  Re: Evaluate Response Xpath assertion fail the policy
    Best Answer

    Broadcom Employee
    Posted Nov 27, 2018 10:55 AM
      |   view attached

    Hello,

     

    Please see the attached.

     

    Regards,

    Joe