Reference / Attributes to customize XML serialization |
Starting with Genero 2.0, you can add optional attributes to the definition of variables. These attributes can be used to map a BDL data type used in the input or output message of a Genero Web Service application to a specific XML data type, rather than using the default. For example, BDL does not have a BOOLEAN data type. If an XML Schema boolean data type is required for an application, you can use an attribute to map a BDL SMALLINT to a boolean.
The following example uses the XSDBoolean attribute to map a BDL SMALLINT variable to an XML Schema boolean type, and assigns an uppercase name as the XMLName attribute:
GLOBALS DEFINE invoice_out RECORD ok SMALLINT ATTRIBUTE(XSDBoolean,XMLName="OK") END RECORD END GLOBALS
If you assign your own XMLName attributes, be sure to respect the conventions when using the RPC Service Style.
See the Tutorial: Writing a GWS Server application for additional information about input and output messages.