How To: Add a Custom Tag (XML Node) with XML Attribute Values to a Request or Response Document

Overview

A Sentry use case may require that you add a custom Tag (XML node), with content, to the request or response documents being processed.  This article provides instructions on how to configure this in Sentry.

 

Example Solution

The use case is to add the following custom tag, with namespace and attribute values, to a request document:


<Custom_Tag xmlns="https://www.domain.com/someVD" xmlns:someVD="https://www.domain.com/someVD" someVD:clientTag="client_1000"/>


This can be accomplished with the 2 tasks as outlined below.


  1. Add XML Node
          a. Go to Resources-->Documents and click New to add a new document
          b. Name your document and paste a sample of the request document then Save
          c. Go to Gateway-->Task Lists and click New
          d. Type in a name (i.e. Add Node with Content to Header) and select the Sample Document from #a above. Apply and click New
          e. Select Add XML Node and click Next
          f. Check the node you want to add the new node under and click Apply
          g. At the bottom the Parent should now be filled in. In The Name space type in the Tag name Custom_Tag and Save

  2. Add a Pattern Match task to customize the added custom Tag from #1 above
          a. Go to Resources-->Pattern Match and click New
          b. Name the Policy (i.e. Change_Tag)
          c. Under Regular Expression type in Custom_Tag
          d. Under Replacement type in or paste:
<Custom_Tag xmlns="https://www.domain.com/someVD" xmlns:someVD="https://www.domain.com/someVD" someVD:clientTag="client_1000"/>
          e. Check Replace and Save
          f. Go to Gateway-->Task Lists and click on the Task create in #1 above (Add Node with Content to Header)
          g. Click New and name the Task (i.e. Pattern Match to replace Tag)
          h. Click New under match Policies. Select Full Document for Type and under the Policy Name drop-down select the Change_Tag from #b above and Save
          i. Save again then click Run to test the Task list. You should have pop-ups allowed to see the new Tag and its content added to the request sample document from #1 above

Have more questions? Submit a request

0 Comments

Article is closed for comments.