XmlObjective Generated Code
XMLobjective Generated Code |
The CodeBuilder module automatically generates the integration classes code in the target language of choice. Integration in C++, Java and RDBs (using JDBC and SQL) is supported on multiple platforms (Windows NT/2000, Linux, Sun SPARC and other Unix systems from IBM and HP)
XML document binding is generated from the schema constructs, guaranteeing conformance with the chosen XMLSchema document. Binding is implemented in the Add-to-DOM and Read-from-DOM functions of the generated classes.
The CodeBuilder is fully conformant to XMLSchema syntax, including inheritance/derived types, polymorphic xml document content (using xsi:type attribute), and mapping between XMLSchema datatypes and native language datatypes.
Features of generated code |
Native datatype mapping
XMLSchema datatypes are mapped to the native datatype in the target language (eg. positiveInteger to unsigned int in C++). Data content is automatically converted to the correct type
Add to DOM
a DOM tree is constructed to model the integration object data, with object data under TEXT nodes. This DOM tree can be serialized to an XML document, or used for other downstream processing.
Read from DOM
the DOM tree representing an XML document is interpreted and the TEXT content is extracted to the fields of the integration object
Data as HTML
the integration object data is used to build a html document of the object. This is useful for viewing the XML document content, and testing the integration cycle end-to-end
Polymorphic XML documents
XML documents which use the xsi:type attribute to mark the element type are correctly interpreted. A class of the correct type is dynamically allocated and populated with the XML document content
RDB persistence
SQL scripts are generated to model the integration classes, with a JDBC module generated to provide the persistence statements in Java. This provides an speedy and direct persistence solution, without introducing additional mappings between XML or schema representations
Serialization
generate xml instance documents from generated classes, producing valid xml per the chosen schema
Validation
validate object instances of the generated classes. This validates at the value-level, since the content is guaranteed to be conformant
STL support
STL is used in C++ generated code to support collections of objects (vector) and strings.
Steps to build integration classes |
Define the types objects using the Types Editor, save to a template file
Define the integration objects in the Object Editor
Generate the type classes code from the Types Editor; compile
Generate the integration classes code from the Object Editor; compile
Use the generated classes to integrate XML documents to the enterprise system in C++, Java or RDBs
Pre-built samples and templates |
The XMLobjective Integrator distribution includes a sample XMLSchema integration project. This sample can be found under the samples/order directory in the XMLobjective installation path. The contents of the sample are detailed below.
XMLSchema files
order.xsd, addressTypes.xsd
XML files
customerOrder1.xml
Integration templates
Integration template files generated by using the CodeBuilder Types Editor and Object Editor
C++ integration code
Generated C++ integration classes
Java integration code
Generated Java integration classes
RDB integration code
Generated JDBC integration classes and SQL scripts for RDB persistence.
Integration templates are also provided for integration with XML standards in financial services. See the XML in Finance page for more details on templates provided in this area.