The Oracle ATG Web Commerce platform REST Web Services server can return output data in either JavaScript Object Notation (JSON) or eXtensible Markup Language (XML) format. It will enclose all returned data in a JSON object with the name atgResponse
or an atgResponse
XML element.
The following example shows JSON output markup.
{"atgResponse": "280001"}
The following example shows XML output markup.
<atgResponse>280001</atgResponse>
Default Output Markup
Configure your Oracle ATG Web Commerce platform REST Web Server to return output data in the format you choose. The default output format of the server is controlled by its /atg/rest/Configuration/defaultOutputCustomizer
property.
For JSON output, set the property to
/atg/rest/output/JSONOutputCustomizer
.For XML output, set the property to
/atg/rest/output/XMLOutputCustomizer
.
The server will return data in its default output format if you do not specify the output format for an individual request. See Specifying Output Markup for One Request.
Specifying Output Markup for One Request
You can choose either JSON or XML for the returned data of a single Oracle ATG Web Commerce platform REST Web Services request. The output format you specify for an individual request will override the default output markup setting.
To specify the output format for an individual REST Web Services request, include the atg-rest-output
control parameter with that request. Set the value of atg-rest-output
to either json
or xml
. See Control Parameters.
The following example shows a REST Web Services request that includes the atg-rest-output
control parameter. The control parameter specifies that data should be returned using XML markup.
curl -v -b cookies.txt -X GET \ http://servername
:port
/rest/bean/atg/dynamo/Configuration?atg-rest-output=xml