Table of Contents Previous Next PDF


Data Type Mapping and Message Conversion

Data Type Mapping and Message Conversion
This chapter contains the following sections:
Overview of Data Type Mapping and Message Conversion
SALT supports bi-directional data type mapping between WSDL messages and Oracle Tuxedo typed buffers. For each service invocation, the GWWS server converts each message between Oracle Tuxedo typed buffers and SOAP message payloads. A SOAP message payload is the XML effective data encapsulated within the <soap:body> element. For more information, see ?$paratext>?.
For native Oracle Tuxedo services, each Oracle Tuxedo buffer type is described using an XML Schema in the SALT generated WSDL document. Oracle Tuxedo service request/response buffers are represented in regular XML format. For more information, see ?$paratext>?.
For external Web services, each WSDL message is mapped as an Oracle Tuxedo FML32 buffer structure. An Oracle Tuxedo application invokes SALT proxy service using FML32 buffers as input/output. For more information see, ?$paratext>?.
SALT also supports non-SOAP data type mapping (i.e., REST over HTTP in both XML and JSON format. This is initiated when services are exposed as HTTP/REST services. For more information, see REST Data Mapping.
Understanding SALT Message Conversion
SALT message conversion is the message transformation process between SOAP XML data and Oracle Tuxedo typed buffers. SALT introduces two message conversion rules: Inbound Message Conversion, and Outbound Message Conversion.
Inbound Message Conversion
Inbound message conversion is the SOAP XML Payload and Oracle Tuxedo typed buffer conversion process that conforms to “Tuxedo-to-XML data type mapping rules”. Inbound message conversion happens in two phases:
SALT encloses Oracle Tuxedo buffer content using elements <inbuf>, <outbuf> and/or <errbuf> in the SOAP message, the content included within elements <inbuf>, <outbuf> and/or <errbuf> is called “Inbound XML Payload”.
Outbound Message Conversion
Outbound message conversion process is the SOAP XML Payload and Oracle Tuxedo typed buffer conversion process that conforms to the “Tuxedo-to-XML data type mapping rules”. Outbound message conversion happens in two phases:
Table 2‑1 compares inbound message conversion and outbound message conversion .
 
SOAP message payload is encapsulated with <inbuf>, <outbuf> or <errbuf>.
Only Oracle Tuxedo FML32 buffer type is involved.
Tuxedo-to-XML Data Type Mapping for Oracle Tuxedo Services
SALT provides a set of rules for describing Oracle Tuxedo typed buffers in an XML document as shown in Table 2‑2. These rules are exported as XML Schema definitions in SALT WSDL documents. This simplifies buffer conversion and does not require previous Oracle Tuxedo buffer type knowledge.
 
Oracle Tuxedo STRING typed buffers are used to store character strings that terminate with a NULL character. Oracle Tuxedo STRING typed buffers are self-describing.
The STRING data type can be specified with a max data length in the Oracle Tuxedo Service Metadata Repository. If defined in Oracle Tuxedo, the corresponding SOAP message also enforces this maximum. The GWWS server validates the actual message byte length against the definition in Oracle Tuxedo Service Metadata Repository. A SOAP fault message is returned if the message byte length exceeds supported maximums.
If GWWS server receives a SOAP message other than “UTF-8”, the corresponding string value is in the same encoding.
Oracle Tuxedo CARRAY typed buffers store character arrays, any of which can be NULL. CARRAY buffers are used to handle data opaquely and are not self-describing.
The CARRAY buffer raw data is carried within a MIME multipart/related message, which is defined in the “SOAP Messages with Attachments’ specification.
Note:
CARRAY data types can be specified with a max byte length. If defined in Oracle Tuxedo, the corresponding SOAP message is enforced with this limitation. The GWWS server validates the actual message byte length against the definition in the Oracle Tuxedo Service Metadata Repository.
Oracle Tuxedo CARRAY typed buffers store character arrays, any of which can be NULL. CARRAY buffers are used to handle data opaquely and are not self-describing.
The CARRAY data bytes must be encoded with base64Binary before it can be embedded in a SOAP message. Using base64Binary encoding with this opaque data stream saves the original data and makes the embedded data well-formed and readable.
In the SOAP message, the XML element that encapsulates the actual CARRAY data, must be defined with xsd:base64Binary directly.
Note:
CARRAY data types can be specified with a max byte length. If defined in Oracle Tuxedo, the corresponding SOAP message is enforced with this limitation. The GWWS server validates the actual message byte length against the definition in the Oracle Tuxedo Service Metadata Repository.
Oracle Tuxedo MBSTRING typed buffers are used for multibyte character arrays. Oracle Tuxedo MBSTRING buffers consist of the following three elements:
The XML Schema built-in type, xsd:string, represents the corresponding type for buffer data stored in a SOAP message.
The GWWS server only accepts “UTF-8” encoded XML documents. If the Web service client wants to access Oracle Tuxedo services with MBSTRING buffer, the mbstring payload must be represented as “UTF-8” encoding in the SOAP request message.
Note:
The GWWS server transparently passes the “UTF-8” character set string to the Oracle Tuxedo service using MBSTRING Typed buffer format.The actual Oracle Tuxedo services handles the UTF-8 string.
For any Oracle Tuxedo response MBSTRING typed buffer (with any encoding character set), the GWWS server automatically transforms the string into “UTF-8” encoding and sends it back to the Web service client.
Oracle Tuxedo MBSTRING data type can be specified with a max byte length in the Oracle Tuxedo Service Metadata Repository. The GWWS server checks the byte length of the converted MBSTRING buffer value.
The XML Schema built-in type, xsd:anyType, is the corresponding type for XML documents stored in a SOAP message. It allows you to encapsulate any well-formed XML data within the SOAP message.
The actual XML data must be encoded using the “UTF-8” character set. Any original XML document prolog information cannot be carried within the SOAP message.
Note:
The SALT WSDL generator will not have xsd:maxLength restrictions in the generated WSDL document, but the GWWS server will validate the byte length according to the Oracle Tuxedo Service Metadata Repository definition.
Oracle Tuxedo VIEW and VIEW32 typed buffers store C structures defined by Oracle Tuxedo applications.
VIEW structures are defined by using VIEW definition files. A VIEW buffer type can define multiple fields.
VIEW supports the following field types:
VIEW32 supports all the VIEW field types, mbstring, and embedded VIEW32 type.
Each VIEW or VIEW32 data type is defined as an XML Schema complex type. Each VIEW field should be one or more sub-elements of the XML Schema complex type. The name of the sub-element is the VIEW field name. The occurrence of the sub-element depends on the count attribute of the VIEW field definition. The value of the sub-element should be in the VIEW field data type corresponding XML Schema type.
short maps to xsd:short
int maps to xsd:int
long maps to xsd:long
float maps to xsd:float
double maps to xsd:double
char (defined as byte in Oracle Tuxedo Service Metadata Repository definition), maps to xsd:byte
char (defined as char in Oracle Tuxedo Service Metadata Repository definition) maps to xsd:string (with restrictions maxlength=1).
string maps to xsd:string
carray maps to xsd:base64Binary
mbstring maps to xsd:string
Oracle Tuxedo FML and FML32 type buffers are proprietary Oracle Oracle Tuxedo system self-describing buffers. Each data field carries its own identifier, an occurrence number, and possibly a length indicator.
FML supports the following field types:
FML32 supports all the FML field types and FLD_PTR, FLD_MBSTRING, FLD_FML32, and FLD_VIEW32.
FML/FML32 buffers can only have basic data-dictionary-like definitions for each basic field data. A particular FML/FML32 buffer definition should be applied for each FML/FML32 buffer with a different type name.
Each FML/FML32 field should be one or more sub-elements within the FML/FML32 buffer XML Schema type. The name of the sub-element is the FML field name. The occurrence of the sub-element depends on the count and required count attribute of the FML/FML32 field definition.
short maps to xsd:short
int maps to xsd:int
long maps to xsd:long
float maps to xsd:float
double maps to xsd:double
char (defined as byte in Oracle Tuxedo Service Metadata Repository definition) maps to xsd:byte
char (defined as char in Oracle Tuxedo Service Metadata Repository definition) maps to xsd:string
string maps to xsd:string
carray maps to xsd:base64Binary
mbstring maps to xsd:string
view32 maps to tuxtype:view <viewname>
fml32 maps to tuxtype:fml32 <svcname>_p<SeqNum>
To avoid multiple embedded FML32 buffers in an FML32 buffer, a unique sequence number (<SeqNum>) is used to distinguish the embedded FML32 buffers.
Note:
ptr is not supported.
RECORD buffer type represents copybook record. RECORD types must have subtypes that designate individual record structures.
Each RECORD data type is defined as an XML Schema complex type. Each RECORD field should be one or more sub-elements of the XML Schema complex type.
RECORD maps to xsd:complexType
COMP-1 maps to xsd:float
COMP-2 maps to xsd:double
S9(18) maps to xsd:long
9(18) maps to xsd:unsignedLong
S9(9) maps to xsd:int
9(9) maps to xsd:unsignedInt
S9(4) maps to xsd:short
S9(10)V9(10) COMP-3 maps to xsd:decimal
X(1024) maps to xsd:string
@binary=true maps to xsd:base64Binary
X_C_TYPE buffer types are equivalent to VIEW buffer types.
See VIEW/VIEW32
X_COMMON buffer types are equivalent to VIEW buffer types, but are used for compatibility between COBOL and C programs. Field types should be limited to short, long, and string
See VIEW/VIEW32
X_OCTET buffer types are equivalent to CARRAY buffer types
See CARRAY xsd:base64Binary
Oracle Tuxedo STRING Typed Buffers
Oracle Tuxedo STRING typed buffers are used to store character strings that end with a NULL character. Oracle Tuxedo STRING typed buffers are self-describing.
Listing 2‑1 shows a SOAP message for the TOUPPER Oracle Tuxedo service example that accepts a STRING typed buffer.
Listing 2‑1 Soap Message for a String Typed Buffer in TOUPPER Service
<?xml … encoding=”UTF-8” ?>
   ……
   <SOAP:body>
      <m:TOUPPER xmlns:m=”urn:......”>
           <inbuf>abcdefg</inbuf>
      </m:TOUPPER>
   </SOAP:body>
 
The XML Schema for <inbuf> is:
<xsd:element name=”inbuf” type=”xsd:string” />
Oracle Tuxedo CARRAY Typed Buffers
Oracle Tuxedo CARRAY typed buffers are used to store character arrays, any of which can be NULL. They are used to handle data opaquely and are not self-describing. Oracle Tuxedo CARRAY typed buffers can map to xsd:base64Binary or MIME attachments. The default is xsd:base64Binary.
Mapping Example Using base64Binary
Listing 2‑2 shows the SOAP message for the TOUPPER Oracle Tuxedo service, which accepts a CARRAY typed buffer using base64Binary mapping.
Listing 2‑2 Soap Message for a CARRAY Typed Buffer Using base64Binary Mapping
<SOAP:body>
       <m:TOUPPER xmlns:m=”urn:......”>
              <inbuf>QWxhZGRpbjpvcGVuIHNlc2FtZQ==</inbuf>
       </m:TOUPPER>
</SOAP:body>
 
The XML Schema for <inbuf> is:
<xsd:element name=”inbuf” type=”xsd:base64Binary” />
Mapping Example Using MIME Attachment
Listing 2‑3 shows the SOAP message for the TOUPPER Oracle Tuxedo service, which accepts a CARRAY typed buffer as a MIME attachment.
Listing 2‑3 Soap Message for a CARRAY Typed Buffer Using MIME Attachment
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type=text/xml;
    start="<claim061400a.xml@example.com>"
Content-Description: This is the optional message description.

--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claim061400a.xml@ example.com>

<?xml version='1.0' ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
..
<m:TOUPPER xmlns:m=”urn:…”>
<inbuf href="cid:claim061400a.carray@example.com"/>
</m:TOUPPER>
..
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--MIME_boundary
Content-Type: text/xml
Content-Transfer-Encoding: binary
Content-ID: <claim061400a. carray @example.com>

...binary carray data…
--MIME_boundary--
The WSDL for carray typed buffer will look like the following:
<wsdl:definitions …>
<wsdl:types …>
<xsd:schema …>
<xsd:element name=”inbuf” type=”xsd:base64Binary” />
</xsd:schema>
</wsdl:types>

……

<wsdl:binding …>
    <wsdl:operation name=”TOUPPER”>
           <soap:operation …>
           <input>
                 <mime:multipartRelated>
                      <mime:part>
                           <soap:body parts=”…” use=”…”/>
                      </mime:part>
                      <mime:part>
                           <mime:content part=”…” type=”text/xml”/>
                      </mime:part>
                 </mime:multipartRelated>
           </input
           ……
    </wsdl:operation>
</wsdl:binding>

</wsdl:definitions>
 
Oracle Tuxedo MBSTRING Typed Buffers
Oracle Tuxedo MBSTRING typed buffers are used for multibyte character arrays. Oracle Tuxedo MBSTRING typed buffers consist of the following three elements:
Note:
You cannot embed multibyte characters with non “UTF-8” code sets in the SOAP message directly.
Listing 2‑4 shows the SOAP message for the MBSERVICE Oracle Tuxedo service, which accepts an MBSTRING typed buffer.
 
Listing 2‑4 SOAP Message for an MBSIRING Buffer
<?xml encoding=”UFT-8”?>
  <SOAP:body>
     <m:MBSERVICE xmlns:m=”http://......”>
         <inbuf>こんにちは</infuf>
     </m:MBSERVICE>
 
The XML Schema for <inbuf> is:
<xsd:element name=”inbuf” type=”xsd:string” />
WARNING:
If you use another character set conversion engine, the EUC-JP or Shift-JIS multibyte output for this character may be different. For example, the Java il8n character conversion engine, converts this symbol to UTF-16 0x2014. The result is the also same when converting to UTF-8, which is the SALT default.
If you use another character conversion engine and Japanese "—" is included in MBSTRING, Oracle Tuxedo server-side MBSTRING auto-conversion cannot convert it back into Shift-JIS or EUC-JP.
Oracle Tuxedo XML Typed Buffers
Oracle Tuxedo XML typed buffers store XML documents.
Listing 2‑5 shows the Stock Quote XML document.
Listing 2‑6 shows the SOAP message for the STOCKINQ Oracle Tuxedo service, which accepts an XML typed buffer.
Listing 2‑5 Stock Quote XML Document
<?xml version="1.0" encoding="UTF-8"?>
<!-- "Stock Quotes". -->
<stockquotes>
  <stock_quote>
     <symbol>BEAS</symbol>
     <when>
       <date>01/27/2001</date>
       <time>3:40PM</time>
     </when>
     <change>+2.1875</change>
     <volume>7050200</volume>
  </stock_quote>
</stockquotes>
 
Then part of the SOAP message will look like Listing 2‑6:
Listing 2‑6 SOAP Message for an XML Buffer
<SOAP:body>
       <m: STOCKINQ xmlns:m=”urn:......”>
       <inbuf>
       <stockquotes>
              <stock_quote>
                     <symbol>BEAS</symbol>
                     <when>
                     <date>01/27/2001</date>
                     <time>3:40PM</time>
                     </when>
                     <change>+2.1875</change>
                     <volume>7050200</volume>
              </stock_quote>
       </stockquotes>
       </inbuf>
       </m: STOCKINQ >
</SOAP:body>
 
The XML Schema for <inbuf> is:
<xsd:element name=”inbuf” type=”xsd:anyType” />
Note:
For example, if an Oracle Tuxedo service returns a buffer having a default namespace to the GWWS server as shown in Listing 2‑7, the GWWS server converts the default namespace to a regular name as shown in Listing 2‑8.
Listing 2‑7 Default Namespace Before Sending to GWWS Server
<Configuration xmlns="http://www.bea.com/Tuxedo/Salt/200606">
       <Servicelist id="simpapp">
              <Service name="toupper"/>
       </Servicelist>
       <Policy/>
       <System/>
       <WSGateway>
          <GWInstance id="GWWS1">
              <HTTP address="//myhost:8080"/>
         </GWInstance>
       </WSGateway>
</Configuration>
 
Listing 2‑8 GWWS Server Converts Default Namespace to Regular Name
       <dom0:Configuration
       xmlns:dom0="http://www.bea.com/Tuxedo/Salt/200606">
              <dom0:Servicelist dom0:id="simpapp">
                     <dom0:Service dom0:name="toupper"/>
              </dom0:Servicelist>
              <dom0:Policy></<dom0:Policy>
              <dom0:System></<dom0:System>
              <dom0:WSGateway>
                <dom0:GWInstance dom0:id="GWWS1">
                     <dom0:HTTP dom0:address="//myhost:8080"/>
                </dom0:GWInstance>
              </dom0:WSGateway>
       </dom0:Configuration>
 
Oracle Tuxedo VIEW/VIEW32 Typed Buffers
Oracle Tuxedo VIEW and VIEW32 typed buffers are used to store C structures defined by Oracle Tuxedo applications. You must define the VIEW structure with the VIEW definition files. A VIEW buffer type can define multiple fields.
Listing 2‑9 shows the MYVIEW VIEW definition file.
Listing 2‑10 shows the SOAP message for the MYVIEW Oracle Tuxedo service, which accepts a VIEW typed buffer.
Listing 2‑9 VIEW Definition File for MYVIEW Service
VIEW MYVIEW
#type     cname       fbname       count       flag       size       null
float     float1       -            1           -          -          0.0
double    double1      -            1           -          -          0.0
long      long1        -            3           -          -          0
string    string1      -            2           -          20        '\0'
END
 
Listing 2‑10 SOAP Message for a VIEW Typed Buffer
<SOAP:body>
       <m: STOCKINQ xmlns:m=”http://......”>
              <inbuf>
                     <float1>12.5633</float1>
                     <double1>1.3522E+5</double1>
                     <long1>1000</long1>
                     <long1>2000</long1>
                     <long1>3000</long1>
                     <string1>abcd</string1>
                     <string1>ubook</string1>
              </inbuf>
       </m: STOCKINQ >
</SOAP:body>
 
The XML Schema for <inbuf> is shown in Listing 2‑11.
Listing 2‑11 XML Schema for a VIEW Typed Buffer
<xsd:complexType name=” view_MYVIEW”>
  <xsd:sequence>
       <xsd:element name=”float1” type=”xsd:float” />
       <xsd:xsd:element name=”double1” type=”xsd:double” />
       <xsd:element name=”long1” type=”xsd:long” minOccurs=”3” />
       <xsd:element name=”string1” type=”xsd:string minOccurs=”3” />
  </xsd:sequence>
</xsd: complexType >
<xsd:element name=”inbuf” type=”tuxtype:view_MYVIEW” />
 
VIEW/VIEW32 Considerations
The following considerations apply when converting Oracle Tuxedo VIEW/VIEW32 buffers to and from XML.
You must create an environment for converting XML to and from VIEW/VIEW32. This includes setting up a VIEW directory and system VIEW definition files. These definitions are automatically loaded by the GWWS server.
The GWWS server provides strong consistency checking between the Oracle Tuxedo Service Metadata Repository VIEW/VIEW32 parameter definition and the VIEW/VIEW32 definition file at start up.
If an inconsistency is found, the GWWS server cannot start. Inconsistency messages are printed in the ULOG file.
tmwsdlgen also provides strong consistency checking between the Oracle Tuxedo Service Metadata Repository VIEW/VIEW32 parameter definition and the VIEW/VIEW32 definition file at start up. If an inconsistency is found, the GWWS server will not start. Inconsistency messages are printed in the ULOG file.
If the VIEW definition file cannot be loaded, tmwsdlgen attempts to use the Oracle Tuxedo Service Metadata Repository definitions to compose the WSDL document.
Because dec_t is not supported, if you define VIEW fields with type dec_t, the service cannot be exported as a Web service and an error message is generated when the SALT configuration file is loading.
Although the Oracle Tuxedo Service Metadata Repository may define a size attribute for “string/ mbstring” typed parameters (which represents the maximum byte length that is allowed in the Oracle Tuxedo typed buffer), SALT does not expose such restriction in the generated WSDL document.
When a VIEW32 embedded MBString buffer is requested and returned to the GWWS server, the GWWS miscalculates the required MBString length and reports that the input string exceeds the VIEW32 maxlength. This is because the header is included in the transfer encoding information. You must include the header size when defining the VIEW32 field length.
The Oracle Tuxedo primary data type “long” is indefinite between 32-bit and 64-bit scope, depending on the platform. However, the corresponding xsd:long schema type is used to describe 64-bit numeric values.
If the GWWS server runs in 32-bit mode, and the Web service client sends xsd:long typed data that exceeds the 32-bit value range, you may get a SOAP fault.
Oracle Tuxedo FML/FML32 Typed Buffers
Oracle Tuxedo FML and FML32 typed buffer are proprietary Oracle Tuxedo system self-describing buffers. Each data field carries its own identifier, an occurrence number, and possibly a length indicator.
FML Data Mapping Example
Listing 2‑12 shows the SOAP message for the TRANSFER Tuxedo service, which accepts an FML typed buffer.
The request fields for service LOGIN are:
ACCOUNT_ID 1 long /* 2 occurrences, The withdrawal account is 1st, and the deposit account is 2nd */
AMOUNT 2 float /* The amount to transfer */
Part of the SOAP message is shown in Listing 2‑12:
Listing 2‑12 SOAP Message for an FML Typed Buffer
<SOAP:body>
       <m:TRANSFER xmlns:m=”urn:......”>
              <inbuf>
                     <ACCOUNT_ID>40069901</ACCOUNT_ID>
                     <ACCOUNT_ID>40069901</ACCOUNT_ID>
                     <AMOUNT>200.15</AMOUNT>
              </inbuf>
       </m:TRANSFER >
</SOAP:body>
 
The XML Schema for <inbuf> is shown in Listing 2‑13.
Listing 2‑13 XML Schema for an FML Typed Buffer
<xsd:complexType name=” fml_TRANSFER_In”>
  <xsd:sequence>
       <xsd:element name=”ACCOUNT_ID” type=”xsd:long” minOccurs=”2”/>
       <xsd:element name=” AMOUNT” type=”xsd:float” />
  </xsd:sequence>
</xsd: complexType >
<xsd:element name=”inbuf” type=”tuxtype: fml_TRANSFER_In” />
 
FML32 Data Mapping Example
Listing 2‑14 shows the SOAP message for the TRANSFER Oracle Tuxedo service, which accepts an FML32 typed buffer.
The request fields for service LOGIN are:
CUST_INFO 1 fml32 /* 2 occurrences, The withdrawal customer is 1st, and the deposit customer is 2nd */
ACCOUNT_INFO 2 fml32 /* 2 occurrences, The withdrawal account is 1st, and the deposit account is 2nd */
AMOUNT 3 float /* The amount to transfer */
Each embedded CUST_INFO includes the following fields:
CUST_NAME       10       string
CUST_ADDRESS    11       carray
CUST_PHONE      12       long
Each embedded ACCOUNT_INFO includes the following fields:
ACCOUNT_ID       20       long
ACCOUNT_PW       21       carray
Part of the SOAP message is shown in Listing 2‑14:
Listing 2‑14 SOAP Message for Service with FML32 Buffer
<SOAP:body>
   <m:STOCKINQ xmlns:m=”urn:......”>
       <inbuf>
              <CUST_INFO>
                     <CUST_NAME>John</CUST_NAME>
                     <CUST_ADDRESS>Building 15</CUST_ADDRESS>
                     <CUST_PHONE>1321</CUST_PHONE>
              </CUST_INFO>
              <CUST_INFO>
                     <CUST_NAME>Tom</CUST_NAME>
                     <CUST_ADDRESS>Building 11</CUST_ADDRESS>
                     <CUST_PHONE>1521</CUST_PHONE>
              </CUST_INFO>
              <ACCOUNT_INFO>
                     <ACCOUNT_ID>40069901</ACCOUNT_ID>
                     <ACCOUNT_PW>abc</ACCOUNT_PW>
              </ACCOUNT_INFO>
              <ACCOUNT_INFO>
                     <ACCOUNT_ID>40069901</ACCOUNT_ID>
                     <ACCOUNT_PW>zyx</ACCOUNT_PW>
              </ACCOUNT_INFO>

              <AMOUNT>200.15</AMOUNT>
       </inbuf>
   </m: STOCKINQ >
</SOAP:body>
 
The XML Schema for <inbuf> is shown in Listing 2‑15.
Listing 2‑15 XML Schema for an FML32 Buffer
<xsd:complexType name=”fml32_TRANSFER_In”>
  <xsd:sequence>
     <xsd:element name=”CUST_INFO” type=”tuxtype:fml32_TRANSFER_p1” minOccurs=”2”/>
     <xsd:element name=”ACCOUNT_INFO” type=”tuxtype:fml32_TRANSFER_p2” minOccurs=”2”/>
     <xsd:element name=”AMOUNT” type=”xsd:float” />
  /xsd:sequence>
</xsd:complexType >

<xsd:complexType name=”fml32_TRANSFER_p1”>
     <xsd:element name=”CUST_NAME” type=”xsd:string” />
     <xsd:element name=”CUST_ADDRESS” type=”xsd:base64Binary” />
     <xsd:element name=”CUST_PHONE” type=”xsd:long” />
</xsd:complexType>

<xsd:complexType name=”fml32_TRANSFER_p2”>
     <xsd:element name=”ACCOUNT_ID” type=”xsd:long” />
     <xsd:element name=”ACCOUNT_PW” type=”xsd:base64Binary” />
</xsd:complexType>

<xsd:element name=”inbuf” type=”tuxtype: fml32_TRANSFER_In” />
 
FML/FML32 Considerations
The following considerations apply to converting Oracle Tuxedo FML/FML32 buffers to and from XML.
You must create an environment for converting XML to and from FML/FML32. This includes an FML field table file directory and system FML field definition files. These definitions are automatically loaded by the GWWS. FML typed buffers can be handled only if the environment is set up correctly.
FML32 field type FLD_PTR is not supported.
The GWWS server provides strong consistency checking between the Oracle Tuxedo Service Metadata Repository FML/FML32 parameter definition and FML/FML32 definition file during start up.
If an FML/32 field is found that is not in accordance with the environment setting, or the field table field data type definition is different from the parameter data type definition in the Oracle Tuxedo Service Metadata Repository, the GWWS cannot start. Inconsistency messages are printed in the ULOG file.
The tmwsdlgen command checks for consistency between the Oracle Tuxedo Service Metadata Repository FML/FML32 parameter definition and FML/FML32 definition file. If inconsistencies are found, it issues a warning and allows inconsistencies.
If an FML/32 field is found that is not in accordance with the environment setting, or the field table field data type definition is different from the parameter data type definition in the Oracle Tuxedo Service Metadata Repository, tmwsdlgen attempts to use Oracle Tuxedo Service Metadata Repository definitions to compose the WSDL document.
Although the Oracle Tuxedo Service Metadata Repository may define a size attribute for “string/mbstring” typed parameters, which represents the maximum byte length that is allowed in the Oracle Tuxedo typed buffer, SALT does not expose such restriction in the generated WSDL document.
Oracle Tuxedo primary data type “long” is indefinite between 32-bit and 64-bit scope according to different platforms. But the corresponding xsd:long schema type is used to describe 64-bit numeric value. The following scenario generates a SOAP fault:
The GWWS runs in 32-bit mode, and a Web service client sends a xsd:long typed data which exceeds the 32-bit value range.
Oracle Tuxedo RECORD Typed Buffers
Oracle Tuxedo RECORD typed buffers can describe COBOL copybook information.
Listing 2‑16 shows the myRecord COBOL copybook file.
Listing 2‑16 COBOL copybook myRecord
01 myRecord.
05 name occurs 1 times PIC X(10).
05 num occurs 1 times PIC S9(9) COMP-5.
05 subgroup occurs 1 times.
10 long1 PIC S9(9) COMP-5.
10 string1 PIC X(19).
 
Listing 2‑17 SOAP Message for a RECORD Typed Buffer
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:urn="urn:pack.TuxAll_typedef.salt11">
<soapenv:Header/>
<soapenv:Body>
<urn:QUERY soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<inbuf xsi:type="urn:record_QUERY_In_myRecord">
<name>John</name>
<num xsi:type="xsd:int">999</num>
<subgroup xsi:type="urn:record_QUERY_In__p3">
<long1 xsi:type="xsd:int">1000</long1>
<string1>abcd</string1>
</subgroup>
</inbuf>
</urn:QUERY>
</soapenv:Body>
</soapenv:Envelope>
 
The XML Schema for <inbuf> is shown in Listing 2‑18.
Listing 2‑18 Schema for a RECORD Typed Buffer
<xsd:complexType name="record_QUERY_In_myRecord">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="name">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"></xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="num" type="xsd:int"></xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="subgroup" type="tuxtype:record_QUERY_In__p3"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="record_QUERY_In__p3">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="long1" type="xsd:int"></xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="string1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="19"></xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType
 
REDEFINES Handling
Redefines are handled using the core RECORD implementation, which takes a cpy2record binary output with boolean expressions to perform choice decisions. GWWS leverages these capabilities when processing records and used them to determine the redefine member to select in the outgoing message (inbound reply and outbound request).
For incoming messages (inbound request and outbound reply) the choice should have been performed by the other side.
In order to make use of cpy2record binaries, GWWS loads the RECORD description files (for example,VIEW/VIEW32 compiled definitions), and rely on the RECORDFILES/RECORDDIR environment variables. By specifying keyword "union" in the MIF file, the items keep the REDEFINE relationship.
Oracle Tuxedo X_C_TYPE Typed Buffers
Oracle Tuxedo X_C_TYPE typed buffers are equivalent (and have a similar WSDL format to), Oracle Tuxedo VIEW typed buffers.They are transparent for SOAP clients. However, even though usage is similar to the Oracle Tuxedo VIEW buffer type, SALT administrators must configure the Oracle Tuxedo Service Metadata Repository for any particular Oracle Tuxedo service that uses this buffer type.
Note:
All View related considerations also take effect for X_C_TYPE typed buffer.
Oracle Tuxedo X_COMMON Typed Buffers
Oracle Tuxedo X_COMMON typed buffers are equivalent to Oracle Tuxedo VIEW typed buffers. However, they are used for compatibility between COBOL and C programs. Field types should be limited to short, long, and string.
Oracle Tuxedo X_OCTET Typed Buffers
Oracle Tuxedo X_OCTET typed buffers are equivalent to CARRAY.
Note:
Oracle Tuxedo X_OCTET typed buffers can only map to xsd:base64Binary type. SALT 1.1 does not support MIME attachment binding for Oracle Tuxedo X_OCTET typed buffers.
Custom Typed Buffers
SALT provides a plug-in mechanism that supports custom typed buffers. You can validate the SOAP message against your own XML Schema definition, allocate custom typed buffers, and parse data into the buffers and other operations.
XML Schema built-in type xsd:anyType is the corresponding type for XML documents stored in a SOAP message. While using custom typed buffers, you should define and represent the actual data into an XML format and transfer between the Web service client and Oracle Tuxedo Web service stack. As with XML typed buffers, only a single root XML buffer can be stored in the SOAP body. The GWWS checks this for consistency.
For more plug-in information, see Using SALT Plug-Ins.
XML-to-Tuxedo Data Type Mapping for External Web Services
SALT maps each wsdl:message as an Oracle Tuxedo FML32 buffer structure. SALT defines a set of rules for representing the XML Schema definition using FML32. To invoke external Web Services, you need to understand the exact FML32 structure that converted from the external Web Service XML Schema definition of the corresponding message.
The following sections describe detailed WSDL message to Oracle Tuxedo FML32 buffer mapping rules:
XML Schema Built-In Simple Data Type Mapping
Table 2‑3 shows the supported XML Schema Built-In Simple Data Type and the corresponding Oracle Tuxedo FML32 Field Data Type.
 
In a 32-bit Oracle Tuxedo program, the C primitive type long cannot represent all xsd:long valid value.
In a 32-bit Oracle Tuxedo program, the C primitive type unsigned long cannot represent all xsd:long valid value.
(and all xsd:string derived built-in type, such as xsd:token, xsd:Name, etc.)
xsd:string can be optionally mapped as FLD_STRING or FLD_MBSTRING using wsdlcvt.
The following samples demonstrate how to prepare data in a Oracle Tuxedo program for XML Schema Built-In Simple Types.
 
 
<xsd:element name=”message” type=”xsd:string” />
 
<xsd:element name=”mem_snapshot” type=”xsd:hexBinary” />
FBFR32 * request;
FLDLEN32 len;
char * buf;
buf = calloc( ... );
...
memcpy(buf, “...”, len); /* copy the original memory */
Fadd32( request, mem_snapshot, buf, len);
 
<xsd:element name=”IssueDate” type=”xsd:date” />
FBFR32 * request;
char date[32];
...
strcpy(date, “2007-06-04+8:00”); /* Set the date value correctly */
Fadd32( request, IssueDate, date, 0);
XML Schema User Defined Data Type Mapping
Table 2‑7 lists the supported XML Schema User Defined Simple Data Type and the corresponding Oracle Tuxedo FML32 Field Data Type.
 
<xsd:simpleType> derived from built-in primitive simple data types
Equivalent FML32 Field Type of the primitive simple type (see Table 2‑3)
Facets defined with <xsd:restriction> are not enforced in Oracle Tuxedo.
<xsd:simpleType> defined with <xsd:list>
Same as <xsd:anyType>. The Schema compliancy is not enforced in Oracle Tuxedo..
<xsd:simpleType> defined with <xsd:union>
Same as <xsd:anyType>. The Schema compliancy is not enforced in Oracle Tuxedo..
<xsd:complexType> defined with <xsd:simpleContent>
Same as <xsd:anyType>. The Schema compliancy is not enforcedin Oracle Tuxedo..
<xsd:complexType> defined with <xsd:complexContent>
Same as <xsd:anyType>. The Schema compliancy is not enforcedin Oracle Tuxedo..
<xsd:complexType> defined with shorthand <xsd:complexContent>, sub-elements composited with sequence or all
<xsd:complexType> defined with shorthand <xsd:complexContent>, sub-elements composited with choice
The following samples demonstrate how to prepare data in an Oracle Tuxedo program for XML Schema User Defined Data Types:
 
<xsd:element name=”Grade” type=”Alphabet” />
<xsd:simpleType name=”Alphabet”>
<xsd:restriction base=”xsd:string”>
<xsd:maxLength value=”1” />
<xsd:pattern value=”[A-Z]” />
</xsd:restriction>
</xsd:simpleType>
char grade[2];
FBFR32 * request;
...
grade[0] = ‘A’; grade[1] = ‘\0’;
Fadd32( request, Grade, (char *)grade, 0);
 
<xsd:element name=”Users” type=”namelist” />
<xsd:simpleType name=”namelist”>
<xsd:list itemType=”xsd:NMTOKEN”>
</xsd:simpleType>
char * user[5];
char users[...];
char * mbpacked;
FLDLEN32 mbsize = 1024;
FBFR32 * request;
...
sprintf(users, “<n1:Users xmlns:n1=\”urn:sample.org\”>”);
for ( i = 0 ; i < 5 ; i++ ) {
strcat(users, user[i]);
strcat(users, “ “);
}
strcat(users, “</n1:Users>“);
...
mbpacked = malloc(mbsize);
/* prepare mbstring*/
Fmbpack32(“utf-8”, users, strlen(users), mbpacked, &mbsize, 0);
Fadd32( request, Users, mbpacked, mbsize);
Note:
In Table 2‑10, attributes are supported in External Web Services calls using the form "<xs:attribute name="[name]" type="[type]"/>" only. Qualifiers such as "fixed=" are currently not supported."
 
WSDL Message Mapping
Oracle Tuxedo FML32 buffer type is always used in mapping WSDL messages.
Table 2‑11 lists the WSDL message mapping rules defined by SALT.
 
<wsdl:input> message
Oracle Tuxedo Response Buffer with TPSUCCESS (Output buffer)
<wsdl:fault> message
Each message part defined in <wsdl:input> or <wsdl:output>
Mapped as top level field in the Oracle Tuxedo FML32 buffer. Field type is the equivalent FML32 field type of the message part XML data type. (See Table 2‑3 and Table 2‑7)
<faultcode> in SOAP 1.1 fault message
Mapped as a fixed top level FLD_STRING field (faultcode) in the Oracle Tuxedo error buffer:
<faultstring> in SOAP 1.1 fault message
Mapped as a fixed top level FLD_STRING field (faultstring) in the Oracle Tuxedo error buffer:
<faultactor> in SOAP 1.1 fault message
Mapped as a fixed top level FLD_STRING field (faultactor) in the Oracle Tuxedo error buffer:
<Code> in SOAP 1.2 fault message
Mapped as a fixed top level FLD_FML32 field (Code) in the Oracle Tuxedo error buffer, which containing two fixed sub FLD_STRING fields (Value and Subcode):
<Reason> in SOAP 1.2 fault message
Mapped as a fixed top level FLD_FML32 field (Reason) in the Oracle Tuxedo error buffer, which containing zero or more fixed sub FLD_STRING field (Text):
<Node> in SOAP 1.2 fault message
Mapped as a fixed top level FLD_STRING field (Node) in the Oracle Tuxedo error buffer:
<Role> in SOAP 1.2 fault message
Mapped as a fixed top level FLD_STRING field (Role) in the Oracle Tuxedo error buffer:
<detail> in SOAP fault message
Mapped as a fixed top level FLD_FML32 field in the Oracle Tuxedo error buffer:
Mapped as a sub field of “detail” field in the Oracle Tuxedo FML32 buffer. Field type is the equivalent FML32 field type of the message part XML data type. (See Table 2‑3 and Table 2‑7)
REST Data Mapping
This section contains the following topics:
Note:
If a VIEW32 buffer is used as input of an Oracle Tuxedo service exposed as a RESTful service using GET or DELETE, and that VIEW32 contains an MBSTRING type, some content must be specified in the calling query string as MBSTRING type fields cannot be defaulted.
If not , the call results in an HTTP 500 error, with TPEINVAL being returned with the following ULOG message:
...
181356.hostname!server.5535.451673280.0: GP_CAT:1582: ERROR: Input codeset encoding argument not defined
...
Inbound Message Conversion
This section contains the following topics:
Query String Mapping
For GET and DELETE methods, input data is passed as an HTTP query string.
Data passed as query string can be mapped within the limitations of query string representation:
keyword=value model, when applicable. For simple buffer types the actual data may be passed directly, e.g.: http://host:1234/myTOUPPER?inputstring
The mapping is described below for the different types of buffers supported by Oracle Tuxedo.
 
Data represented as URL encoded of UTF-8 representation of the Oracle Tuxedo MBSTRING.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
GWWS attempts to convert values to the corresponding VIEW/VIEW32 member depending on the target type: number types from their string representation to their Oracle Tuxedo ones:
float notation for float and double VIEW/VIEW32 types
FLD_CHAR fields are translated from URL-encoded content(i.e., representable characters or their '%xx' representation string for all other types)
The fieldname=value notation is used with:
FBNAME field name when configured in the view description.
CNAME value when no FBNAME is present in the view description.
If neither FBNAME nor CNAME matches for this subtype, a mapping error is returned.
GWWS attempts to convert values to the corresponding VIEWFML/VIEWFML32 member depending on the target type: number types from their string representation to their Oracle Tuxedo ones:
float notation for float and double VIEWFML/VIEWFML32 types
integer notation for int, long and other integer-based types
FLD_CHAR fields are translated from URL-encoded content (i.e., representable characters or their '%xx' representation
string for all other types
GWWS attempts to convert values to the corresponding RECORD buffer member depending on the target type.
JSON Data Mapping
The different Oracle Tuxedo buffer types are converted into/from JSON as shown in Table 2‑13.
 
Table 2‑13 JSON Data Mapping
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
{'<fieldname>':'<fieldcontent>', '<fieldname>':'<fieldcontent>'}
{'<fieldname>':{'<fieldname>':'<fieldcontent>'}}
VIEW/VIEW32 field types are mapped as follows (Oracle Tuxedo type: JSON type):
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 are rendered as JSON strings.
short: Number
int: Number
long: Number
float: Number
double: Number
char: String
string: String
carray: String (base64 encoded)
bool: boolean
signed char: String
wchar_t* or wchar_t: String
unsigned int: Number
long long: String (See notes below table)
unsigned long long: String (See notes)
long double: String (See notes below table)
mbstring: String
view32: nested JSON record
{'<fieldname>':'<fieldcontent>', '<fieldname>':'<fieldcontent>'}
{'<fieldname>':{'<fieldname>':'<fieldcontent>'}}
FML/FML32 field types are mapped as follows (Oracle 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_STRING: String
FLD_CARRRAY: String (base64 encoded)
FLD_MBSTRING: String
FLD_VIEW32: JSON nested record, see VIEW/VIEW32 mapping for individual types
FLD_FML32: JSON object
Nested FLD_VIEW32: the name of the view subtype must be the name of the embedded VIEW32. For Example:
VIEW32 example.v definition file:
JSON content (EVIEW32 is a FLD_VIEW32 fml32 type):
Notes:
Non-structured buffer types (STRING, CARRAY, X_OCTET and MBSTRING) will not wrap data as JSON objects, the data is transmitted as is.
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.
VIEW/VIEW32 Considerations
The following considerations apply when converting Oracle Tuxedo VIEW/VIEW32 buffers to and from XML:
You must create an environment for converting XML to and from VIEW/VIEW32. This includes setting up a VIEW directory and system VIEW definition files. These definitions are automatically loaded by the GWWS server.
FML/FML32 Considerations
The following considerations apply to converting Oracle Tuxedo FML/FML32 buffers to and from XML:
You must create an environment for converting XML to and from FML/FML32. This includes an FML field table file directory and system FML field definition files. These definitions are automatically loaded by the GWWS. FML typed buffers can be handled only if the environment is set up correctly.
Note:
FML32 Field type FLD_PTR is not supported.
XML Data Mapping
XML data mapping is performed using similar rules as the mapping used in SOAP mode.
The following differences are to be noted:
Simple buffers (STRING, CARRAY, MBSTRING and XML) are sent and received as is, without any XML processing. The behavior is identical to JSON processing (i.e.,no mapping is necessary)_.
FML and FML32 requests are wrapped by a root element (which name is ignored, as long as the XML is formed properly), and replies are wrapped in an element with the same name as the subtype as specified in the REST/Service/Method/@inputbuffer attribute of the SALTDEPLOY configuration file, or <root> element, since there is not necessarily one if subtype is not configured. VIEW, VIEW32, X_COMMON and X_C_TYPE buffers are the subtype name as root element name.
The different Oracle Tuxedo buffer types are converted into/from XML as shown in Table 2‑14.
 
Table 2‑14 XML Data Mapping
Oracle Tuxedo STRING typed buffers are used to store character strings that terminate with a NULL character. Oracle Tuxedo STRING typed buffers are self-describing.
Oracle Tuxedo CARRAY typed buffers store character arrays, any of which can be NULL. CARRAY buffers are used to handle data opaquely and are not self-describing.
Oracle Tuxedo MBSTRING typed buffers are used for multibyte character arrays. Oracle Tuxedo MBSTRING buffers consist of the following three elements:
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Oracle Tuxedo XML typed buffers store XML documents.
Only a single root XML buffer is allowed to be stored in the payload; the GWWS server checks for this.
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
Oracle Tuxedo VIEW and VIEW32 typed buffers store C structures defined by Oracle Tuxedo applications.
VIEW structures are defined by using VIEW definition files. A VIEW buffer type can define multiple fields.
VIEW supports the following field types:
carray (represented as base64 encoded content)
VIEW32 supports all the VIEW field types, mbstring, and embedded VIEW32 type.
The name of the sub-element is the VIEW field name. The occurrence of the sub-element depends on the count attribute of the VIEW field definition. The value of the sub-element should be in the VIEW field data type corresponding XML Schema type.
Oracle Tuxedo FML and FML32 type buffers are proprietary Oracle Oracle Tuxedo system self-describing buffers. Each data field carries its own identifier, an occurrence number, and possibly a length indicator.
FML supports the following field types:
FLD_CARRAY (as base64 encoded content)
FML32 supports all the FML field types and FLD_PTR, FLD_MBSTRING, FLD_FML32, and FLD_VIEW32.
Nested FLD_VIEW32: the name of the view subtype must be the name of the embedded VIEW32. For Example:
XML content (EVIEW32 is a FLD_VIEW32 fml32 type):
RECORD buffer type represents copybook record. RECORD types must have subtypes that designate individual record structures.
<myRecord>
  <name>aaa</name>
  <num>1000</num>
  <subgroup>
    <long1> 3000 </long1>
    <string1> www </string1>
  </subgroup>
</myRecord>
Note:
Non-structured buffer types (STRING, CARRAY, X_OCTET and MBSTRING) do not wrap data as XML objects, the data is transmitted as is.
VIEW/VIEW32 Considerations:
The following considerations apply when converting Oracle Tuxedo VIEW/VIEW32 buffers to and from XML:
You must create an environment for converting XML to and from VIEW/VIEW32. This includes setting up a VIEW directory and system VIEW definition files. These definitions are automatically loaded by the GWWS server.
FML/FML32 Considerations
The following considerations apply to converting Oracle Tuxedo FML/FML32 buffers to and from XML:
You must create an environment for converting XML to and from FML/FML32. This includes an FML field table file directory and system FML field definition files. These definitions are automatically loaded by the GWWS. FML typed buffers can be handled only if the environment is set up correctly.
Note:
FML32 Field type FLD_PTR is not supported.
Outbound Message Conversion
This section contains the following topics:
Query String Mapping
Note:
Attempting to use embedded FML32 and VIEW32 fields will result in a TPEPROTO error in this mode.
For GET and DELETE methods, requested data is passed as an HTTP query string. For example:http://host:1234/banking?account=1234
Data passed as query string can be mapped within the limitations of query string representation:
keyword=value model, when applicable. For simple buffer types the actual data may be passed directly(e.g., http://host:1234/svc?inputstring).
The mapping is as described inTable 2‑15 for different types of buffers supported by OracleTuxedo.
 
Data represented as URL encoded of UTF-8 representation of the Tuxedo MBSTRING.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
GWWS attempts to convert values to the corresponding VIEW/VIEW32 member depending on the target type: number types from their string representation to their Oracle Tuxedo ones:
float notation for float and double VIEW/VIEW32 types
integer notation for int, long and other integer based types
FLD_CHAR fields are translated from URL-encoded content, i.e. representable characters or their '%xx' representation
string for all other types
The fieldname=value notation is used with:
FBNAME field name when one is configured in the view description.
CNAME value when no FBNAME is present in the view description.
If neither FBNAME nor CNAME matches for this subtype a mapping error is returned.
GWWS attempts to convert values to the corresponding FML/FML32 member depending on the target type: number types from their string representation to their Tuxedo ones:
float notation for float and double FML/FML32 types
integer notation for int, long and other integer-based types
FLD_CHAR fields are translated from URL-encoded content (i.e., representable characters or their '%xx' representation
string for all other types
GWWS attempts to convert values to the corresponding RECORD member depending on the target type.
JSON Data Mapping
The different Tuxedo buffer types are converted into/from JSON as shown in Table 2‑16.
 
Table 2‑16 JSON Data Mapping
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
{'<fieldname>':'<fieldcontent>', '<fieldname>':'<fieldcontent>'}
{'<fieldname>':{'<fieldname>':'<fieldcontent>'}}
short: Number
int: Number
long: Number
float: Number
double: Number
char: String
string: String
carray: String (base64 encoded)
bool: boolean
signed char: String
wchar_t* or wchar_t: String
unsigned int: Number
long double: String (See notes)
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.
{'<fieldname>':'<fieldcontent>', '<fieldname>':'<fieldcontent>'}
{'<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
FLD_FML32: JSON bject
Nested FLD_VIEW32: the name of the view subtype must be the name of the embedded VIEW32. For Example:
VIEW32 example .v definition file:
RECORD buffer field types are mapped as follows (Tuxedo type: JSON type):
Notes:
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.
VIEW/VIEW32 Considerations:
The following considerations apply when converting Oracle Tuxedo VIEW/VIEW32 buffers to and from XML:
You must create an environment for converting XML to and from VIEW/VIEW32. This includes setting up a VIEW directory and system VIEW definition files. These definitions are automatically loaded by the GWWS server.
FML/FML32 Considerations
The following considerations apply to converting Oracle Tuxedo FML/FML32 buffers to and from XML:
You must create an environment for converting XML to and from FML/FML32. This includes an FML field table file directory and system FML field definition files. These definitions are automatically loaded by the GWWS. FML typed buffers can be handled only if the environment is set up correctly.
Note:
FML32 Field type FLD_PTR is not supported.
Conversion Examples:
Listing 2‑19 VIEW Description File
VIEW empname
#TYPE CNAME FBNAME COUNT FLAG SIZE NULL
char fname EMP_FNAME 1 - 25 -
char minit EMP_MINIT 1 - 1 -
char lname EMP LNAME 1 - 25 -
END
 
VIEW emp
struct empname ename 1 - - -
unsignedlong id EMP_ID 1 - - -
long ssn EMP_SSN 1 - - -
double salaryhist EMP_SAL 10 - - -
END
 
Corresponding header file after compilation
Listing 2‑20 Compilation
struct empname {
char fname[25];
char minit;
char lname[25];
};
 
struct emp {
struct empname ename;
unsigned long id;
long ssn;
double salaryhist[10];
}
 
JSON Content Example
Listing 2‑21 JSON Content Example
{
"ename":
{
"EMP_FNAME":"John",
"EMP_MINIT":"R",
"EMP_LNAME":"Smith"
},
"EMP_ID":1234,
"EMP_SSN":123456789,
"EMP_SAL":
[10000.0,
11000.0,
12000.0,
13000.0,
14000.0,
15000.0,
16000.0,
17000.0,
18000.0,
19000.0]
}
}
 
Without FBNAME(names specified in the view file), the content is represented using the CNAME values. Since nesting cannot be expressed without field names because the field name is also the subtype name for the nested view, only structures with 1 level are represented.
For example:
Listing 2‑22 VIEW Description
VIEW empname
#TYPE CNAME FBNAME COUNT FLAG SIZE NULL
char fname - 1 - 25 -
char minit - 1 - 1 -
char lname - 1 - 25 -
END
 
Corresponding header file after compilation
Listing 2‑23 Compilation
struct empname {
char fname[25];
char minit;
char lname[25];
};
 
Listing 2‑24 JSON Content Example
{
"fname":"John",
"minit":"R",
"lname":"Smith"
}
 
FML32 Example
Listing 2‑25 Field Table
#name rel-number type flags comment
 
BIKES 1 fml32 -
COLOR 2 string -
CURSERIALNO 3 string -
INSTOCK 4 string -
NAME 5 string -
ORDERDATE 6 string -
PRICE 7 float -
SERIALNO 8 string -
SIZE 9 long -
SKU 10 string -
TYPE 11 string -
 
Listing 2‑26 JSON Content Example
 
"BIKES":
[
{"COLOR":"BLUE",
"CURSERIALNO":"AZ123",
"INSTOCK":"Y",
"NAME":"CUTTER",
"ORDERDATE":"11/03/2012",
"PRICE":1234.55,
"SERIALNO":"123456",
"SIZE":52,
"SKU":"CU521234",
"TYPE":"ROAD"},
{"COLOR":"RED",
"CURSERIALNO":"BZ123",
"INSTOCK":"Y",
"NAME":"ROCKGLIDER",
"ORDERDATE":"11/06/2012",
"PRICE":1455.55,
"SERIALNO":"123457",
"SIZE":16,
"SKU":"RG161234",
"TYPE":"MTB"},
]
}
}
 
Record example.
Listing 2‑27 COBOL copybook
01 myRecord.
05 name occurs 1 times PIC X(10).
05 num occurs 1 times PIC S9(9) COMP-5.
05 subgroup occurs 1 times.
10 long1 PIC S9(9) COMP-5.
10 string1 PIC X(19).
 
Listing 2‑28 Result
{
"name": "aaa",
"num": 1000,
"subgroup": {
"long1": 3000,
"string1": "wwww"
}
}
 
XML Data Mapping
XML data mapping is performed using similar rules as the mapping used in SOAP mode.
Note the following:
Simple buffers (STRING, CARRAY, MBSTRING, and XML) are sent and received as is, without any XML processing. The behavior is identical to JSON processing (i.e.,no mapping is necessary.
FML and FML32 requests must be wrapped by a root element (which name is ignored, as long as the XML is formed properly), and replies are wrapped in an element with the same name as the subtype as specified in the HTTP/Service/@outputbuffer attribute of the SALTDEPLOY configuration file, or <root> element if subtype is not configured. VIEW, VIEW32, X_COMMON, and X_C_TYPE buffers use the subtype name as the root element name.
The different Oracle Tuxedo buffer types are converted into/from XML in the following manner as shown in Table 2‑17
 
Table 2‑17 XML Data Mapping
Oracle Tuxedo STRING typed buffers are used to store character strings that terminate with a NULL character. Oracle Tuxedo STRING typed buffers are self-describing.
Oracle Tuxedo CARRAY typed buffers store character arrays, any of which can be NULL. CARRAY buffers are used to handle data opaquely and are not self-describing.
Oracle Tuxedo MBSTRING typed buffers are used for multibyte character arrays. Oracle Tuxedo MBSTRING buffers consist of the following three elements:
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Oracle Tuxedo XML typed buffers store XML documents.
Only a single root XML buffer is allowed to be stored in the payload; the GWWS server checks for this.
In order to transmit encodings other than UTF-8, the "enableMultiEncoding" property must be set to "true" in the SALTDEPLOY configuration.
Same as VIEW/VIEW32
Same as VIEW/VIEW32
Same as CARRAY
Oracle Tuxedo VIEW and VIEW32 typed buffers store C structures defined by Oracle Tuxedo applications.
VIEW structures are defined by using VIEW definition files. A VIEW buffer type can define multiple fields.
int
carray (represented as base64 encoded content)
wchar_t* or wchar_t
VIEW32 supports all the VIEW field types, mbstring, and embedded VIEW32 type.
The name of the sub-element is the VIEW field name. The occurrence of the sub-element depends on the count attribute of the VIEW field definition. The value of the sub-element should be in the VIEW field data type corresponding XML Schema type.
Oracle Tuxedo FML and FML32 type buffers are proprietary Oracle Oracle Tuxedo system self-describing buffers. Each data field carries its own identifier, an occurrence number, and possibly a length indicator.
FLD_CARRAY (as base64 encoded content)
FML32 supports all the FML field types and FLD_PTR, FLD_MBSTRING, FLD_FML32, and FLD_VIEW32.
Nested FLD_VIEW32: the name of the view subtype must be the name of the embedded VIEW32. For Example:
RECORD buffer type represents copybook record. RECORD types must have subtypes that designate individual record structures.
<myRecord>
  <name>aaa</name>
  <num>1000</num>
  <subgroup>
    <long1> 3000 </long1>
    <string1> www </string1>
  </subgroup>
</myRecord>
Note:
Non-structured buffer types (STRING, CARRAY, X_OCTET and MBSTRING) will not wrap data as XML objects, the data is transmitted as is.
VIEW/VIEW32 Considerations:
The following considerations apply when converting Oracle Tuxedo VIEW/VIEW32 buffers to and from XML:
You must create an environment for converting XML to and from VIEW/VIEW32. This includes setting up a VIEW directory and system VIEW definition files. These definitions are automatically loaded by the GWWS server.
FML/FML32 Considerations
The following considerations apply to converting Oracle Tuxedo FML/FML32 buffers to and from XML:
You must create an environment for converting XML to and from FML/FML32. This includes an FML field table file directory and system FML field definition files. These definitions are automatically loaded by the GWWS. FML typed buffers can be handled only if the environment is set up correctly.
Note:
FML32 Field type FLD_PTR is not supported

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.