...
Also see the following sections in the WSO2 ESB EI documentation. WSO2 ESB EI is used to implement the API Gateway through which API messages are transformed:
- Accessing content from JSON payloads
- Logging JSON payloads
- Constructing and transforming JSON payloads
- Troubleshooting, debugging, and logging
JSON message builders and formatters
...
org.apache.axis2.json.JSONBuilder/JSONMessageFormatter
org.apache.axis2synapse.commons.json.JSONStreamBuilderJsonStreamBuilder/JSONStreamFormatter
org.apache.axis2.json.JSONBadgerfishOMBuilder/JSONBadgerfishMessageFormatter
...
Tip | ||
---|---|---|
To support having spaces inside JSON attributes, change the default JSON builder and formatter to the following pair in either <APIM_HOME>/repository/conf/axis2/axis2.xml (super tenant scenario) or <APIM_HOME>/repository/conf/axis2/tenant-axis2.xml (tenant scenario) file:
|
Tip | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
To support use cases for JSON payloads with arrays, change the default JSON builder and formatter to the following pair in either
Else, in JSON to XML conversion, there might be issues as below:
|
...
Note that we have used the Property mediator to mark the outgoing payload to be formatted as JSON. For more information about the Property Mediator, see the Property Mediator page on WSO2 ESB EI documentation.
Code Block | ||
---|---|---|
| ||
<property name="messageType" value="application/json" scope="axis2"/> |
...
Info | ||
---|---|---|
| ||
See JSON Transformation Parameters for additional parameters for converting XML to JSON. |