Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Parse XML rule not able to handle Null Values

SA-19616

Summary



Application is getting null values in the response from service and Parse XML rule not able to handle Null values present in Response xml.please find below log error for the same.


Error Messages



Caught EXception while parsing XML

com.pega.pegarules.integration.engine.internal.ServiceHelper.applyXMLParseRuleWithParam(ServiceHelper.java:5988)
at com.pega.pegarules.integration.engine.internal.ServiceHelper.setInboundDataValue(ServiceHelper.java:1691)
at com.pega.pegarules.integration.engine.internal.ServiceHelper.mapInboundData(ServiceHelper.java:1298)
at com.pega.pegarules.integration.engine.internal.util.PRServiceUtils.mapInboundData(PRServiceUtils.java:1163)
... 102 more
Caused by:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the element content of the document.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.pega.pegarules.integration.engine.internal.mapping.xml.XMLParserBase.parseDocument(XMLParserBase.java:507)
... 108 more

Steps to Reproduce



Step 1 : Call the service through connect-MQ
Step 2 : Use data such that in the Response null values should be there.

Root Cause



Incoming XML contains unicode NULL values which makes XML invalid.

 Unicode NUL (0x00) is illegal in all versions of XML and validating parsers must reject input that contains it
 

http://stackoverflow.com/questions/11036799/hexadecimal-value-0x00-is-a-invalid-character

http://stackoverflow.com/questions/8170739/dealing-with-invalid-xml-hexadecimal-characters


RESOLUTION

Remove 
these illegal characters before parsing so MQ Service doesn’t send these characters or need to handle these before performing parsing operation.

Published February 15, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us