JSONiq in IBM DataPower Gateway
The JSONiq extensions to XQuery are supported by the DataPower Gateway, allowing you to use the JSONiq hybrid output method to dynamically choose the output format.
The default output method is the JSON-XML hybrid approach. It is not necessary to declare the output namespace or output method in the script. Dynamically selected output formats, such as JSON or XML, are used.
If the business has a lot of purchase orders, the objects might be kept in a sizable JSON array.
We can handle the JSON payload in many ways in DataPower.
Let’s configure one of the ways to handle JSON payload in DataPower.
Transform with a processing control file, if specified.
- Let’s create a sample loopback service to demonstrate the transform action functionality.
- Let’s create a sample JSON XQuery file (.xq file) for JSON requests.
- Upload the JSON XQuery file to the data power local directory.
- Create processing policy and processing rules.
- Drag the transform action onto the rule.
Double-tap the transform icon.
- Select the transform with a processing control file, if specified.
- Select JSON in the input language field.
- Select XQuery in the transform language field.
- Give the path of the JSON XQuery file in the transform file field.
- Click done and configure the remaining service as required.
- Use any testing tool to test the Service.