Code Generator Output
HydraExpress generates a C++ class for each complex type, top-level element, and sequence or choice defined in the XML Schema. Table 3 shows the schema definitions and the corresponding classes.
Table 1 – Classes generated for po.xsd schema
Schema definition | Type of definition | Resulting C++ Class |
---|
purchaseOrder | Top-level element | PurchaseOrder |
PurchaseOrderType | Named complex type | PurchaseOrderType |
USAddress | Named complex type | USAddress |
Items | Named complex type | Items |
item | Anonymous complex type | ItemsItem |
The
item anonymous complex type takes its name from the enclosing element, and the resulting class name reflects the fact that the element is nested within the
Items complex type. For a complete description of how schema definitions are reflected in the generated code, see
Chapter 8, Mapping XML Schema to C++.The generator creates many additional files to support the XML data binding, including marshaling classes, makefiles, a sample application, and HTML documentation. For a complete listing, see
Generated Files.
Files are separated into several subdirectories according to type, as shown below.
basicExample/
app/
data
codegen/
data
docs/
include/
<projectname>
<namespace>
The directory app contains the sample application, and the directory include contains relevant include and header files organized by project name and then by namespace, if the schema includes one. The directory codegen contains the source files for the datatype and marshaling classes, and it contents should not be modified. The docs directory contains HTML documentation, with single-click access provided through the index.html file.
For more information on the code generation directory structure, see “The Generated Project Directory,” in the HydraExpress Web Service Development Guide.
To use the sample application located in the directory basicExample\apps\data, add your application logic to it. For the purposes of this example, use the provided implemented application, po_main.cpp, located in the directory installdir\examples\xmlbinding\basic.
NOTE: Source code files other than those in the app directory are not overwrite protected. You should never add business logic or make any other changes to the generated source code as these changes are lost the next time the code is generated.