The XPath-Query 1.0 throws NullPointerException if the Path Expression "namespace-uri" cannot be identified in the XML document.
Please see example Assertion:
<Please see attached file for image>
The Policy aborts and the Gateway returns a message like the following example:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<faultactor/>
<detail/>
</soapenv:Fault>
</soapenv:Body>
The seen behavior is based on the XPath 1.0 error handling and is expected.
The error handling of XPath has been enhanced in version 2.0.
XPath 2.0 don't throw a NullPointerException and don't abort the Policy, if the Path Expression "namespace-uri" cannot be identified in the XML document.
Select Version 2.0 on the Evaluate Request XPath Assertion in order to prevent the Policy to abort.