Layer7 API Management

 View Only

Add or Remove XML Element(s) Assertion sample policy 

Nov 02, 2017 02:57 PM

A sample policy using the 'Add or Remove XML Element(s)' Assertion.
Instructions:

To test this policy:

1. Create a testing endpoint on your Gateway, i.e: /addXml , /removeXml

2. Import the attached policy into the respective endpoint

3. Send one of the sample messages below to the Gateway depending on your needs (add or remove)

 

Sample XML for removing the PRICE element:

<bookstore>

<book category="API">

   <title lang="en">CA API Management</title>

   <author>John Doe</author>

   <year>2017</year>

   <price>30.00</price>

</book>

</bookstore>

 

removeXml.png

 

Sample XML for adding the PRICE element:

<bookstore>

<book category="API">

   <title lang="en">CA API Management</title>

   <author>John Doe</author>

   <year>2017</year>

</book>

</bookstore>

 

addXml.png

 

This policy is provided as-is without warranty or support of any kind and intended only for guidance in using the assertion. This must not be used on production systems.

Statistics
0 Favorited
5 Views
1 Files
0 Shares
2 Downloads
Attachment(s)
zip file
AddRemoveXML.zip   1 KB   1 version
Uploaded - May 29, 2019

Tags and Keywords

Related Entries and Links

No Related Resource entered.