XPath-Query 1.0 throws NullPointerException
search cancel

XPath-Query 1.0 throws NullPointerException

book

Article ID: 6435

calendar_today

Updated On:

Products

STARTER PACK-7 CA Rapid App Security CA API Gateway

Issue/Introduction

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>

xpath.png

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> 

 

 

Environment

Release:
Component: APIGTW

Cause

The seen behavior is based on the XPath 1.0 error handling and is expected.

Resolution

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. 

Attachments

1558714695831000006435_sktwi1f5rjvs16tj7.png get_app