Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Web Service Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

21.2 The Project File

When the code generator rwsfgen is invoked, a top-level configuration file is created which contains all project elements, including any WSDLs or XML Schemas provided to the generator, all generation options, and any special mappings or other elements used as an argument during code generation. This file supports a project structure of any complexity and allows you to easily maintain your project using one file.

The code generator accepts any file of any name that adheres to this schema, so you can easily create and maintain your own project files that contain special options or elements you wish to use for particular projects.

One useful technique is to create a customized project file containing special generation options that you want your project to use. If you provide this file to HydraExpress, it will use it to generate code and then merge its contents with a new, generated project file. See Section 20.6.1, "Adding Options and Customized Mappings to the HydraExpress Project File," for more information.

This section discusses a sample project file, adding options to a project file, and the HydraExpress project schema.

21.2.1 A Sample Project File

Let's look at a simple project file. If you generated code using the default options for the example DayOfWeek located in your <installdir>\tutorials\webservices\DayOfWeek directory, you will have the following project file in a code generation directory DayofWeekExample:

//1The options element includes all options, either default options, or options provided to the generator on the command line. For instance, because the DayOfWeek example uses SourcePro classes and the -sourcepro option was used at code generation, the stl value is "false." All other options here contain the default values. (See Section 20.6 for a list of all generator options and their default values.)
//2The project-name is a required option and is the basis for the name of the generated project file, as well as the name of the code generation directory.

Note: HydraExpress supports only file paths without spaces, so do not include spaces in file or directory names.

//3The outdir value corresponds to the name of the code generation directory, including its full path. This value based on the provided project-name.
//4The mapping element contains any customized datatype mappings you provided to the generator. In this case it is empty, as we are using the default mappings.
//5The files element lists all WSDLs or XML Schemas provided to the generator. Any number of WSDLs or schemas are supported.

If you wish to override elements in the project file, you may enter them on the command line. Any options entered on the command line override those inside the HydraExpress project file. Likewise, elements in the HydraExpress project file override those in the platform properties file. In addition, if you provide more than one HydraExpress project file to the code generator, the values in the last project file override any previously-set values in the event of conflicts. See Section 20.6.3 for more information on property precedence.

21.2.2 Adding Options to a Project File Vs. Adding them to the Command Line

Adding options to a project file requires a slightly different syntax than adding them to the command line. The command line accepts options prefaced with "no", such as "nohtml" or "noserver," while the project file instead requires a simple option value of "false".

For example, to override the default setting that always generates documentation, on the command line, you would enter:

However, in a project file, you would enter:

21.2.3 Creating a Customized Project File for Special Generation Options

HydraExpress reads any file of any name that contains supported project file options. This ability provides a great degree of flexibility while generating code.

The advantage of this feature is that, for instance, if you want code to be regularly generated using a particular option, you can create an XML file specifying that option and provide it as an argument to the generator. The code generator uses the options contained in any such file to generate code, and then merges these options with the HydraExpress project file it generates.

For example, if you want to always generate code with the -whitespace and
-sourcepro options, you could create a HydraExpress project file titled standard-properties.xml. If you used this as an argument to the code generator, you would not need to specify these options on the command line.



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.