Generating Code from Schema
To generate the output for the schema describing the Purchase Order XML document:
1. Follow the instructions in Chapter 2, “Setup,” in the HydraExpress User Guide to set up your environment.
2. Open a command prompt and navigate to the directory installdir\examples\xmlbinding\namespace.
3. Invoke the code generator as shown below:
rwsfgen example-project.xml
The HydraExpress project file example-project.xml provided as an argument specifies the schema po1.xsd, assigns a project name namespaceExample on which the code generation directory is based, and also includes the options to use SourcePro classes and to include whitespace when marshaling.
This invocation is the same as entering the options and files directly on the command line as follows:
rwsfgen -projectname namespaceExample -sourcepro -whitespace po1.xsd
NOTE: SourcePro is not included with HydraExpress. It is a separate product from Rogue Wave Software and must be purchased additionally.
For more information on the use of HydraExpress project files in shipped examples, see “The Use of the HydraExpress Project File in Shipped Examples,” in the HydraExpress User Guide. For complete information about the command-line options, see Generator Options,” in the HydraExpress Web Service Development Guide.
NOTE: The example program in this section uses SourcePro C++ classes. The provided po1_main.cpp file will not compile if you use the -stl binding. The -sourcepro option is specified in the HydraExpress project file example-project.xml used as an argument above. For more information on the HydraExpress project file, see “The Generated Project Directory,” in the HydraExpress Web Service Development Guide.