JSON XML Transformation
Functions to transform JSON XML messages.
TIBCO API Exchange Gateway can handle non-XML request and response messages, and provide XSLT extension functions to handle non-XML message serializations.
Using the mapping feature of TIBCO API Exchange Gateway, you can transform the messages as follows:
- Request message from one message format to other format using the forward mapper. For example, use the northbound forward mapper to modify the JSON request to an XML request. See BookQueryBE Example Request Message.
- Response message from one message format to other format using the reverse mapper. For example, use northbound reverse mapper to modify the XML response message format to a JSON response message format. See BookQuery Example Response Message.
To support the JSON XML message transformations, TIBCO API Exchange Gateway provides the following options:
JSON Extension
The JSON extension is defined in the namespace http://www.tibco.com/asg/functions/json
JSON Schema
TIBCO API Exchange Gateway provides the following built-in schema for JSON message:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:json="http://www.tibco.com/asg/content-types/json" targetNamespace="http://www.tibco.com/asg/content-types/json" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="json_xml"> <xs:complexType> <xs:sequence> <xs:element ref="json:list"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="list"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="json:text"/> <xs:element ref="json:double"/> <xs:element ref="json:list"/> <xs:element ref="json:dict"/> </xs:choice> <xs:attribute name="key" type="xs:string"/> </xs:complexType> </xs:element> <xs:element name="text"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="key" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="double"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="key" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="dict"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="json:text"/> <xs:element ref="json:double"/> <xs:element ref="json:list"/> </xs:choice> <xs:attribute name="key" type="xs:string"/> </xs:complexType> </xs:element> </xs:schema>
Copyright © Cloud Software Group, Inc. All rights reserved.