Notifications

604 views

Description

When using setStringParameter() function in a script to populate fields of an Outbound REST Message configuration, you may try to use escape international / accented characters (like á, à, í, ì, etc.) in a JSON payload. This may result in a failure on the other endpoint or cause escaping issues on ServiceNow instance.

Cause

Outbound REST Message configurations can be configured to send out payloads with XML or JSON notation. XML is a strict defined type, and many non-ASCII characters need to be encoded in their unicode equivalent representation (like á -> &#00E0). However, JSON is defined to accept UTF-8 encoded characters by default and does not need escaping. This is defined in the following RFC:

Resolution

XML character escaping is not valid for JSON notation. Please use setStringParameterNoEscape(), instead of using setStringParameter() to send out accented letters as they are in a string. Payload should be accepted by the target endpoint.

Article Information

Last Updated:2020-04-16 04:57:44
Published:2020-04-16