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

6.3 The Generated Code

To see the code generated for the WeatherSummary.wsdl, ensure that your environment is set up as discussed in Chapter 2, "Setup," in the Introduction to HydraExpress, open a command prompt, and navigate to the directory <installdir>\tutorials\webservicesug\WeatherSummary.

The command

generates code into a code generation directory WeatherSummaryExample. Because the HydraExpress project file example-project.xml points to a WSDL that contains a schema, the generated project structure will include data subdirectories as well as a relevant namespace directory, as illustrated in Table 3.

In order to simplify this discussion, this table does not list the generated client and server classes, but only the datatype classes.

Table 3: Generated files for an XML Schema 



Project file defining all project elements. See Section 21.3.


Project-level makefiles. Calls all makefiles in subdirectories. Overwrite protected.


Include makefile. Contains all makefile compiler and linker options. Edits to this file cascade down to all makefiles. Overwrite-protected.


Makefiles for app directory. Overwrite protected.


Sample application file.

Overwrite protected.


Makefiles for codegen directory. Overwrite protected.


Makefiles for data directory.
Overwrite protected.


Source files for the datatype classes sorted into separate namespace directories


HTML documentation files



subdirectory projectname


Conversion utility class header file (to convert the simple types defined in the datamap to and from the underlying string class, string)


Header files for the datatype classes

6.3.1 HTML Documentation

The docs directory contains HTML documentation. Single-click access is provided through the index.html file in the docs directory.

6.3.2 The Generated Data Types

The generator creates one data type class named WeatherSummary, based on the complexType's name attribute. The source file for class WeatherSummary is placed into the codegen\data\wsx directory, where wsx is the namespace. The data type header file is placed into the include\WeatherSummary\wsx directory where WeatherSummary is the project name.

Class WeatherSummary provides accessors to work with the data, and also includes unmarshal() methods that populate an instance of the class from a serialized WeatherSummary type element, and marshal() methods for converting an instance of the class to a serialized format. These methods pass the marshaling and unmarshaling logic to the generated external marshaling class, WeatherSummaryMarshal. This class contains the logic to unmarshal and marshal the data and is called by WeatherSummary's unmarshal() and marshal() methods. Unless you are customizing the marshaling and unmarshaling process in some way, you do not need to explicitly use the marshaling class.

The directory app\data contains the sample application, and the directory include contains relevant include and header files.

Source code other than that in the app directory is not overwrite protected. You should never add business logic or make any other changes to the generated source code, as these changes will be lost the next time the code is generated.

6.3.3 The Data "main" Sample Application

To use the sample application WeatherSummary_1_main.cpp located in the directory WeatherSummaryExample\apps\data, add your application logic to it. This file is generated to help you quickly create an application main that uses the generated API to marshal and unmarshal your code. Edit this file to replace the TODO items with your application logic.

The example WeatherSummary does not ship with an implemented sample main application, as its primary focus is to illustrate various aspects of developing Web services.

For examples that do include implemented main applications, see any example in the <installdir>\tutorials\xmlbinding directory.

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.