Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Web Service Development Guide

20.6 Generator Options

The rwsfgen program accepts the options listed in Table 12:

Table 12: Code generator options

Option Effect
-projectname name Specify a name for the project. This option results in a HydraExpress project file named name. Required.
no arguments or -help Entering rwsfgen with no arguments, or with -h or with -help launches usage information or "help" for the rwsfgen program. The output lists all optional arguments included in this table. This is a command line option only.
-noclean Disable file and directory cleanup at the end of the code generation. This can be useful for troubleshooting. Default is -clean.
-noclient Do not generate client-side code or a sample application for the client. Default is -client.
-nohtml Do not generate HTML pages that document the generated classes. For large schemas, specifying this option may greatly reduce code generation time. Default is -html.
-nomake Do not generate a makefile. Default is -make.
-nosample Do not generate a sample client or a sample service implementation. Default is -sample.
-noserver Do not generate server-side code or a server implementation. Default is -server.
-childTypeAttr Control whether the xsi:Type attribute is present in the controlling child elements of complex types. Default is -nochildtypeattr. (Applicable only to schema types that appear in Web service messages.)
-haltonerror
-nohaltonerror
Control whether code generation halts when it encounters an error, or goes ahead and generates code. May be useful to ensure code generation for known schema errors (for instance, in the event that they occur in an unused part of the schema). Default is -haltonerror.
-datamap Specify file containing the datamap used for XML Schema to C++ datatypes. Note: This option overrides -sourcepro and -stl. See Section 8.7, "Creating Customized Mappings," in the HydraExpress XML Binding Development Guide.
-logfilename
<name>
Specify a name for the log file. Default is rwsfgen.log.
-makefilename
<name>
Specify a specific name for the generated makefiles. Useful to distinguish between makefile names if generating a project with multiple compilers.
-maxgentypes <some_number> Restrict the number of generated types to be included in a single library. This option is useful for very large, complex schemas that generate more types than some compilers and OS combinations can link. The provided argument specifies the number of types to be included in a single library, so that multiple libraries are created.
-ordinalanonymous Specify that anonymous types in the schema are named "AnonymousType_" with sequential numbering suffixes. This provides a workaround for deeply-nested anonymous definitions that may result in C++ and file name identifiers longer than a compiler or operating system allows. Default is -noordinalanonymous.
-outdir <directory> Put generated files in <directory>. Can be an absolute or a relative path. Default is to generate files in existing directory.
-rwsfhome <path> Specify the RWSF_HOME directory.
-soapenc Generate code for complex types in the SOAP encoding namespace. Default is -nosoapenc.
-sourcepro1 Map XML Schema types to SourcePro C++ classes. For a complete list of the SourcePro C++ type mappings, see Section 8.3, "Simple Types," in the HydraExpress XML Binding Development Guide.
Default is -nosourcepro.
-stl Use a type mapping based on Standard C++ Library classes rather than SourcePro C++ classes. This is the default. For a complete list of the STL type mappings, see Section 8.3, "Simple Types," in the HydraExpress XML Binding Development Guide. This is the default binding. Default is -stl.
-standalone Generate a sample standalone server for running the Web service independent of the HydraExpress Agent. Default is -nostandalone.
-toplevelclasses
-notoplevelclasses
By default, HydraExpress generates classes for the top-level elements in a schema. If the -notoplevelclasses is used, HydraExpress instead generates a convenience class, MySchemaStatics, that contains static variables of the element names so the corresponding type classes can easily marshal the elements. Default is -toplevelclasses.
-whitespace By default, the rwsf::XmlWriter created for marshaling datatypes eliminates all unnecessary whitespace. This improves performance but makes the document difficult to read. If your output documents need to be human readable, specify -whitespace to preserve whitespace such as line breaks and indentations. Default is -nowhitespace.
-wrapped Enable the wrapped style as described in Section 8.3.8, "Wrapped Style Operations." Default is -nowrapped.
-verbose Output informational messages to the console. Default is -noverbose.
-version Print the HydraExpress version number and exit.
  1. The -stl and -sourcepro options affect only the mappings of built-in schema types. Code generated with the -sourcepro option will still contain Standard Library classes for some of its implementations.

20.6.1 Adding Options and Customized Mappings to the HydraExpress Project File

Generally, you will add options directly to the command line when you invoke the generator, and HydraExpress will then merge these options into the generated HydraExpress project file. This way, if you wish to rerun the generator, you do not need to again enter options on the command line, unless they have changed.

You may also choose to change the options directly in the HydraExpress project file before code generation, and provide it as the only argument to the generator.

Alternatively, you may add special options directly to a separate HydraExpress project file, and supply it as an argument to the code generator. This approach allows you to maintain a customized project file containing a specific set of options that you might use on a particular type of project, avoiding the need to enter each one manually at the command line.


If you provide more than one HydraExpress project file to the code generator, the values in the last project file on the command line override any previous values in the event of conflicts. See
Section 20.6.3 for more information on property precedence.

For more information on working with project files, see Section 21.2, "The Project File."

20.6.1.1 Providing Customized Type Mappings to the Code Generator

You may also specify customized type mappings using the <mappings> element of the generated HydraExpress project file, or creating a separate HydraExpress project file containing just a <mappings> element and providing it as an argument to the code generator.

This can allow you to set up customized mappings for schema namespaces, or special character encoding conversions. For more information, see Chapter 8, "Mapping XML Schema to C++," in the HydraExpress XML Binding Development Guide. See also Chapter 19, "Internationalizing Your Services."

20.6.2 Adding Outside Libraries, Includes or Compiler Properties to a Project

To include third-party libraries or other includes in your project, add them to the generated include makefile, makefile.include, located in the top level of your code generation directory. This file is included in the top-level makefiles and supports easy customization and editing of your makefiles. See Chapter 22, "Options for Compiling," for more information.

20.6.3 Conflicting Options and Property Precedence

HydraExpress code generator options may be assigned in several different ways, including in the HydraExpress project file, or on the command line. Because of the many options for configuring the code generator, conflicting assignments can occur for a single property. To ensure that the generator uses the right value for a given property, be aware of the following precedence, from lowest to highest:

  1. Platform properties files

  2. A HydraExpress project file

  3. Command line options assignments

This section details how property precedence works during code generation.

20.6.3.1 Platform Properties and Startup Properties Files

For each supported platform, a properties file is used to configure information needed by the makefile or project file. This file includes options such as compiler flags, linker flags, commands for invoking the compiler and linker, etc. This file is located at <installdir>\conf\common\platforms\<platform-name>.

To change how HydraExpress behaves on a regular basis, such as changing the way the compiler is invoked, edit these files. (To change compiler properties for a specific project, edit the generated makefile.include file. See Section 20.6.2.)

20.6.3.2 The HydraExpress Project File

When a HydraExpress project file is provided to the code generator, its properties override any properties with the same names defined in the platform properties file.

If more than one HydraExpress project file is provided to the code generator, and those files contain conflicting values for any options, the values in the last project file on the command line override values set in an earlier file.

20.6.3.3 Command Line Options

Options can be set on the command line. These assignments override any that have been made in the properties files and any HydraExpress project file.

Note that the order in which options are entered on the command line affects precedence, as well. Options entered last override any options entered earlier on the command line, in the event of a conflict. For a complete list of options, see Section 20.6, "Generator Options."



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.