Specify XPaths in Assertions

Some assertions require you to specify an XPath on which to perform an operation. For example, you may be evaluating a request XPath, encrypting an element, or signing a non-SOAP element. This graphic shows an example of the interface used to select or modify an XPath.
gateway83
Some assertions require you to specify an XPath on which to perform an operation. For example, you may be evaluating a request XPath, encrypting an element, or signing a non-SOAP element. This graphic shows an example of the interface used to select or modify an XPath.
image2014-11-13 12:1:19.png
This interface contains the following elements. Every assertion with an XPath selection task contains these elements; some assertion contain additional elements specific to that assertion.
image2014-11-13 12:1:44.png List of available web services and their operations. The operations shown are retrieved from the WSDL document for the web service. For information about the WSDL that defines a web service, see Publish SOAP Web Service.
image2014-11-13 12:2:16.png The XPath expression selected for the task. If you know the XPath, you can type it directly into this box. For greater flexibility, you may reference context variables within the expression or you may specify a fully-dynamic XPath expression (in the format "${xpathVar}"). For more information, see "Fully Dynamic XPath Expressions" under XPath Context Variables. Alternatively, you can let the Policy Manager build it for you by selecting the target element in the code window.
 
While context variables within the expression are supported by all XPath assertions, fully-dynamic XPath expressions are only available in the Evaluate Request XPath and Evaluate Response XPath assertions. 
 
image2014-11-13 12:3:36.png The code box that displays a sample message for the selected operation. Use the image2014-11-13 12:3:52.png and image2014-11-13 12:4:0.png buttons to collapse and expand the nodes (respectively).
image2014-11-13 12:4:12.png By default, the sample message shown in the code window will be used. You can modify the sample message or enter you own message. For more information, see Create, Edit, Delete Sample Messages.
image2014-11-13 12:4:30.png You can optionally edit the namespace map if necessary. You cannot remove namespaces that originate from the WSDL document. For more information, see "Namespace Map" under Configure Namespaces.
To select an XPath
:
  1. In section image2014-11-13 12:4:58.png, select the operation containing the element you want to use for the task (evaluating, encrypting, etc.) A sample message is displayed in the code window image2014-11-13 12:5:20.png.
  2. Examine the sample message generated by the Policy Manager in image2014-11-13 12:5:44.png to see if it meets your needs. If not, use the
    Sample Messages
    section in image2014-11-13 12:6:9.png to create your own message. Messages generated by the system are limited to elements defined in the WSDL document.
  3. In the code box image2014-11-13 12:6:31.png, click a target element to build your XPath expression. The XPath for this element is displayed in the
    XPath
    field image2014-11-13 12:6:50.png.
    The Policy Manager only builds an XPath expression to an element. For more complex expressions, you must edit the XPath manually in image2014-11-13 12:7:24.png.
  4. Edit the
    XPath
    in image2014-11-13 12:7:45.png if necessary. For greater flexibility, you may reference context variables within the expression. For more information, see XPath Context Variables.
  5. Edit the namespace map in image2014-11-13 12:8:5.png if necessary.