search cancel

Apply JSON Trasformation failed to convert a JSON containing "\u0000".

book

Article ID: 133814

calendar_today

Updated On:

Products

API SECURITY CA API Gateway Precision API Monitoring Module for API Gateway (Layer 7) CA API Gateway Enterprise Service Manager (Layer 7) STARTER PACK-7 CA Microgateway CA API Gateway

Issue/Introduction

Apply JSON Trasformation assertion couldn't convert to XML from the JSON as below:

{

  "str1":"\u0000"

}


The following WARNING message was recorded in the audit log.

2019-06-26T15:14:32.417+0900 WARNING 58388 com.l7tech.external.assertions.jsontransformation.server.ServerJsonTransformationAssertion: 4: Converted XML is invalid.. Exception caught!


What's wrong?


Cause

The string "\u0000" is converted into an invalid XML character (Unicode: 0x0). It's the reason why the conversion failed.

Environment

Release : 9.x

Component : API GATEWAY

Resolution

Please don't make the source JSON include any Unicode escape sequences which cannot be used in the resulting XML.

Input JSON objects can be validated in the "Test" tab of Apply JSON Transformation assertion.

Testing JSON to XML conversion

Additional Information

XML - Character Range

https://www.w3.org/TR/REC-xml/#charsets

Attachments