2.4.1 XML Schema Built-In Simple Data Type Mapping

The following table shows the supported XML Schema Built-In Simple Data Type and the corresponding Oracle Tuxedo FML32 Field Data Type.

Table 2-3 Supported XML Schema Built-In Simple Data Type

XML Schema Built-In Simple Type Oracle Tuxedo FML32 Field Data Type C/C++ Primitive Type In Oracle Tuxedo Program Note
xsd:byte FLD_CHAR char -
xsd:unsignedByte FLD_UCHAR unsigned char -
xsd:boolean FLD_BOOL char/bool

Value Pattern

[ ‘T’ | ‘F’ ]

xsd:short FLD_SHORT short -
xsd:unsignedShort FLD_USHORT unsigned short -
xsd:int FLD_LONG long -
xsd:unsignedInt FLD_UINT unsigned int -
xsd:long FLD_LONG long In a 32-bit Oracle Tuxedo program, the C primitive type long cannot represent all xsd:long valid value.
xsd:long FLD_LLONG long long In a 32-bit Oracle Tuxedo program, the C primitive type long long can represent all xsd:long valid values.
xsd:unsignedLong FLD_LONG unsigned long In a 32-bit Oracle Tuxedo program, the C primitive type unsigned long cannot represent all xsd:long valid value.
xsd:unsignedLong FLD_ULONG unsigned long long In a 32-bit Oracle Tuxedo program, the C primitive type unsigned long can represent all xsd:unsignedLong valid values.
xsd:float FLD_FLOAT float -
xsd:double FLD_DOUBLE double -
xsd:string

(and all xsd:string derived built-in type, such as xsd:token, xsd:Name, etc.)

FLD_STRING

FLD_MBSTRING

char [ ]

wchar_t []

(Null-terminated string)

xsd:string can be optionally mapped as

FLD_STRING

or

FLD_MBSTRING

using wsdlcvt
xsd:base64Binary FLD_CARRAY char[ ] -
xsd:hexBinary FLD_CARRAY char [ ] -
All other built-in data types (Data / Time related, decimal / Integer related, any URL, QName, NOTATION) FLD_STRING char [ ] You should comply with the value pattern of the corresponding XML built-in data type. Otherwise, server-side Web service will reject the request.

The following samples demonstrate how to prepare data in a Oracle Tuxedo program for XML Schema Built-In Simple Types.

  • XML Schema Built-In Type Sample - xsd:string
  • XML Schema Built-In Type Sample - xsd:hexBinary
  • XML Schema Built-In Type Sample - xsd:date

Table 2-4 XML Schema Built-In Type Sample - xsd:string

XML Schema Definition
- <xsd:element name=”message” type=”xsd:string” />
Corresponding FML32 Field Definition (FLD_MBSTRING)
- # Field_name Field_type Field_flag Field_comments message mbstring -
C Pseudo Code
-
FBFR32 * request;
FLDLEN32 len, mbsize = 1024;
char * msg, * mbmsg;
msg = calloc( ... ); mbmsg = malloc(mbsize);
...
strncpy(msg, “...”, len); /* The string is UTF-8 encoding */
Fmbpack32(“utf-8”, msg, len, mbmsg, &mbsize, 0); /* prepare mbstring*/
Fadd32( request, message, mbmsg, mbsize);

Table 2-5 XML Schema Built-In Type Sample - xsd:hexBinary

XML Schema Definition
-
<xsd:element name=”mem_snapshot” type=”xsd:hexBinary” />
Corresponding FML32 Field Definition (FLD_MBSTRING)
-
# Field_name Field_type Field_flag Field_comments
mem_snapshot carray - 
C Pseudo Code
-
FBFR32 * request;
FLDLEN32 len;
char * buf;
buf = calloc( ... );
...
memcpy(buf, “...”, len); /* copy the original memory */
Fadd32( request, mem_snapshot, buf, len);

Table 2-6 XML Schema Built-In Type Sample - xsd:date

XML Schema Definition
-
<xsd:element name=”IssueDate” type=”xsd:date” />
Corresponding FML32 Field Definition (FLD_STRING)
- # Field_name Field_type Field_flag Field_comments IssueDate string -
C Pseudo Code
-
FBFR32 * request;
char date[32];
...
strcpy(date, “2007-06-04+8:00”); /* Set the date value correctly */
Fadd32( request, IssueDate, date, 0);