2.5.2.2 JSON Data Mapping

The different Tuxedo buffer types are converted into/from JSON as shown in the table below:

Table 2-16 JSON Data Mapping

Oracle Tuxedo Buffer Type JSON equivalent/example Notes
STRING <buffer content> -
CARRAY <binary buffer content> -
MBSTRING <Multi-byte string> In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
XML <XML fragment as-is> In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
X_C_TYPE Same as VIEW/VIEW32 -
X_COMMON Same as VIEW/VIEW32 -
X_OCTET Same as CARRAY -
VIEW/VIEW32
{'<fieldname>':'<fieldcontent>',
'<fieldname>':'<fieldcontent>}

possibly nested:

{<fieldname>':{'<fieldname>':'<fieldcontent>'}}

JSON has the following primitive types:

boolean (true/false)

Number (int or double float)

String

VIEW/VIEW32 field types will be mapped as follows (Tuxedo type: JSON type):

  • short: Number
  • int: Number
  • long: Number
  • float: Number
  • double: Number
  • char: String
  • string: String
  • carray
  • bool: boolean
  • unsigned char: String
  • signed char: String
  • wchar_t* or wchar_t: String
  • unsigned int: Number
  • unsigned long: Number
-
-
  • long double: String (See notes)
  • mbstring: String
  • view32: nested JSON record
See VIEW/VIEW32 considerations and examples for fieldname mapping details.

Some types may be truncated if represented in their primitive types (long long, long double), in that case they will be rendered as JSON strings.

FML/FML32 {'<fieldname>':'<fieldcontent>','<fieldname>':'<fieldcontent>'}

possibly nested, FML32 only:

{'<fieldname>':{'<fieldname>':'<fieldcontent>'}}

FML/FML32 field types are mapped as follows (Tuxedo type: JSON type):

  • FLD_SHORT: Number
  • FLD_LONG: Number
  • FLD_FLOAT: Number
  • FLD_DOUBLE: Number
  • FLD_CHAR: String or character 'T' for JSON true or 'F' for JSON false
  • FLD_CARRRAY: String (base64 encoded)
  • FLD_MBSTRING: String
  • FLD_VIEW32: JSON nested record, see VIEW/VIEW32 mapping for individual types

Nested FLD_VIEW32: the name of the view subtype must be the name of the embedded VIEW32. For Example:

VIEW32example .v definition file:

VIEW v32 example
charflag1 - 1 ---
string str - 1 100
- -
JSON content (EVIEW32 is a FLD_VIEW32 fml32 type):
{"EVIEW32" :
 {"v32example":
{"flag1":"x",
"str":"somestring"}
}
}
RECORD {'<fieldname>':'<fieldcontent>','<fieldname>':'<fieldcontent>'}

possibly nested:

{'<fieldname>':{'<fieldname>':'<fieldcontent>'}}

RECORD buffer field types are mapped as follows (Tuxedo type: JSON type):

RECORD: Number

COMP-1: Number

COMP-2: Number

S9(18): Number

9(18): Number

S9(9): Number

9(9): Number

S9(4): Number

S9(10)V9(10)COMP-3L: Number

X(1024): String

@binary=true: String

-

Note:

  • Non-structured buffer types (STRING, CARRAY, X_OCTET and MBSTRING) will not wrap data as JSON objects, the data is transmitted as is. The content-type setting is ignored for those buffer types with respect to data mapping.
  • JSON internally handles all floating point types differently than XML. XML conversion floating point conversion may incur some precision loss over similar JSON conversions. This is currently a limitation.