Back to Contents


The Serializer class

Summary:

See also: The Genero Web Services XML Library


Syntax

The Serializer class provides methods to manage options for the serializer engine, and to use the serializer engine to serialize variables and XML element nodes. This class is a static class and does not have to be instantiated. Notice that status is set to zero after a successful method call.

Syntax

xml.Serializer

Methods

Class Methods
Name Description
xml.Serializer.SetOption(
  flag STRING,
  value STRING )
Sets a global option value for the serializer engine, where flag is the option flag, and value is the value of the flag.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.GetOption(
  flag STRING )
   RETURNING STRING
Gets a global option value from the serializer engine, where flag is the option flag. Returns the value of the flag.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.VariableToStax(
  var VARIABLE,
  stax xml.StaxWriter )
Serializes a 4GL variable into an XML element node using a StaxWriter object, where var is any 4GL variable with optional XML mapping attributes, and stax is a StaxWriter object. The resulting XML element node of the serialization process will be added at the current cursor position of the StaxWriter object.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.StaxToVariable(
  stax xml.StaxReader,
  var VARIABLE )
Serializes an XML element node into a 4GL variable using a StaxReader object, where stax is a StaxReader object where the cursor points to an XML Element node, and var is any 4GL variable with optional XML mapping attributes.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.VariableToDom(
  var VARIABLE,
  node xml.DomNode )
Serializes a 4GL variable into an XML element node using a DomNode object, where var is any 4GL variable with optional XML mapping attributes, and node is a DomNode object of type ELEMENT_NODE or DOCUMENT_FRAGMENT_NODE. The resulting XML element node of the serialization process will be appended to the last child of the given node.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.DomToVariable(
  node xml.DomNode,
  var VARIABLE )
Serializes an XML element node into a 4GL variable using a DomNode object, where node is a DomNode object of type ELEMENT_NODE, and var is any 4GL variable with optional XML mapping attributes.
Throws an exception in case of errors, and updates status with an error code.
 xml.Serializer.VariableToSoapSection5(
  var VARIABLE,
  node xml.DomNode )
Serializes a 4GL variable into an XML element node in Soap Section 5 encoding, where var is any 4GL variable with optional XML mapping attributes, and node is a DomNode object of type ELEMENT_NODE or DOCUMENT_FRAGMENT_NODE.  The resulting XML element node of the serialization process will be appended to the last child of the given node.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.SoapSection5ToVariable(
  node xml.DomNode,
  var VARIABLE )
Serializes an XML element node into a 4GL variable in Soap Section 5 encoding, where node is a DomNode object of type ELEMENT_NODE, and var is any 4GL variable with optional XML mapping attributes.
Throws an exception in case of errors, and updates status with an error code.
xml.Serializer.CreateXmlSchemas(
  var VARIABLE,
  ar DYNAMIC ARRAY OF xml.DomDocument )
Creates XML schemas corresponding to the given variable var, and fills the dynamic array ar with xml.DomDocument objects each representing an XML schema.
Throws an exception in case of errors, and updates status with an error code.

Back to the top


Serialization option flags

Flag Description
xml_ignoretimezone Defines whether, during the marshalling and un-marshalling process of a BDL DATETIME data type, the Serializer should ignore the time zone information. |
A value of zero means FALSE. The default is FALSE.
Throws an exception in case of errors, and updates status with an error code.
xml_usetypedefinition Defines whether the Serializer must specify the type of data during serialization. (This will add an "xsi:type" attribute to each XML data type.)
A value of zero means FALSE. The default is FALSE.
Throws an exception in case of errors, and updates status with an error code.
xml_useutctime Defines whether, during the marshalling process of a BDL DATETIME data type, the Serializer should convert it into UTC time.
A value of zero means FALSE. The default is FALSE.
Throws an exception in case of errors, and updates status with an error code.
xs_processcontents Defines the way to generate wildcard elements and attributes in XML schemas via the XML schema processContents tag.
  • 0 means no processContents tag will be generated. (default)
  • 1 means generation of processContents="skip".
  • 2 means generation of processContents="lax".
  • 3 means generation of processContents="strict".
Throws an exception in case of errors, and updates status with an error code.

Back to the top