Size limit for JSON and XML parsing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 03:02 PM
I'm trying to parse a large body of data, and have been unable to do it using JSON.parse or XmlDocument2 due to its large size.
Javascript compiler exception: WrappedException of java.io.UTFDataFormatException: encoded string too long: 278472 bytes in: ....
Is there a system setting I can use to turn this up or another API to get around this limitation? I'm on Fuji patch 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 03:43 PM
Have you tried both of the following?
Option 1 (uses JavaScript):
var json = new JSON();
var jsObj = json.decode(stringValue);
Option 2 (uses Java):
var json = new JSONParser();
var jsObj = json.parse(stringValue);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 04:08 PM
Yeah, just tried both those and get the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 04:11 PM
Where are you getting the JSON text from?
200KB+ is a lot of data..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 02:33 PM
I'm having the same issue here. The data is coming in from our asset management tool through a SOAP call. The payload field (in the ECC Queue) is a special field designated to allow massive amounts of data. However, as I'm getting back ~60mb worth of data, any attempts to parse or manipulate the response/payload data ends up in errors:
Like when trying to create a new XMLDocument(soap_response):
Problem when trying to get a Rhino object: java.lang.RuntimeException: String object has exceeded max size of 16777216: org.mozilla.javascript.ScriptableObject.examineSize(ScriptableObject.java:2173)
Or when trying to convert the response to a JSON object:
java.lang.RuntimeException: String object has exceeded max size of 16777216
All of the data is in ServiceNow (and in less than 30 seconds), but it seems that I don't have any way of manipulating it.
I have a HI ticket open, but has anyone seen this before and have a solution? (Besides limiting my SOAP return!)