Managing Master Data with webMethods OneData 10.5 | Managing Master Data with webMethods OneData | Developing for webMethods OneData | REST Web Services | Supported Resource Representations
Supported Resource Representations
OneData REST services allow you to use XML and JSON resource representations. The REST API request header Content-Type=application/resource type determines if XML or JSON is the REST resource type. The default resource type is xml, change this value to json for JSON REST APIs.
In OneData, both XML and JSON REST APIs support all OneData object types, with the exception of multi-select and supertype subtype structures.
The data types supported in XML and JSON REST APIs are:
Data Type
Payload in XML String Format
Payload in JSON Format
"NRI" : "true"
"NRI" : true
"Code" : "IND"
"Code" : "IND"
"DOB" : "11.11.2016"
"CGPA" : "9.82"
"CGPA" : 9.82
"ID" : "1001"
"Id" : 1001
"Name" : "John"
"Name" : "John"
"FlightTime": "01.02.2016 11:11:11.999999999"
Advantages and Limitations of JSON Over XML REST APIs
Being more easy to parse, JSON is generally preferred over the XML resource representation. Compared to XML, the JSON payload is easily and accurately processed under the following conditions:
*When no XML name exists, multiple entities in an object hierarchy can have identical column names.
*Simple tags appear after complex tags.
*Complex hierarchies with demoralization issues.
*When no returnColumns are specified for conceptual objects, the response to the JSON request maintains the hierarchical structure of the payload format. Whereas the XML output included denormalized data which was difficult to correlate to the payload format.
However, when using JSON REST APIs, consider the following limitations that are not applicable to XML REST APIs. JSON requests do not support:
*The exception queue, because OneDatadoes not support the REST parameter partialCommit=true.
*Service audit columns, because the property is not currently supported.
*Prefixing the XML Element Name to the object columns. Whereas this is available for XML requests with the use of the property.
*BLOB data type, but supports all other OneData data types.
*CLOB data type, except in insert operations.

Copyright © 2011-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.