User Guide > Publishing Resources > Accessing REST-Based Web Services Using JSON
 
Accessing REST-Based Web Services Using JSON
JSON data objects, including array objects, would need to be created and any nested array objects need to be present before the results can be transferred. Arrays in JSON require that the data be held in memory, which for extremely large arrays can cause out of memory errors. If there are no arrays, then TDV will stream the data for better performance.
Typically, resources that contain XML data types might involve hierarchical data resulting in JSON arrays. So, you should avoid consuming the data from these resources through Web services using REST with JSON format if the resource you are consuming contains one of the following:
The type of output parameter, or the column type in the cursor binding in one of output parameters is an XML type that might result in JSON array if the amount of data is large enough to require an array.
Extremely large amounts of data from an XML formatted object.
For example, the following procedure is likely to perform better if it is consumed through an XML format rather than a JSON format:
proc (out MyFavFunct XML)
 
Review the views and procedures that you want to publish to determine if they contain XML types that will result in JSON arrays or cursors with XML data types. Depending on what you find, determine the best way for you to consume your resources.
See Publishing Resources to a Web Service for more information about consuming resources using JSON.