Web Service Development Guide : PART III Working with Message Patterns : Chapter 10 Solicit-Response and Notification Services : Generating Code
Generating Code
This section discusses how the Weather Summary example is designed to work and the files generated for the Weather Summary WSDL. In addition to the normal client and server classes to support request-response and one-way operations, a special set of notification classes are generated to support notification and solicit-response operations, the two patterns in which the server initiates the message.
Note that the WeatherSummary directory contains provided implementation files and a project file, example-project.xml. This is a HydraExpress project file providing custom configuration information to the generator. In this case, the file assigns a project-name value of WeatherSummaryExample, and directs the generator to generate code using the -whitespace option.
Code Generation Outputs
Generate code by invoking the code generator as described in “Invoking the Generator.” The most straightforward call would be:
 
prompt> rwsfgen example-project.xml
This call generates code into a directory WeatherSummaryExample based on the project name provided in the example-project.xml file. For more information on the use of HydraExpress project files in shipped examples, see Chapter 2, “Setup,” in the HydraExpress User Guide.
Table 5 shows the code and configuration files that are generated for the WeatherSummary service. This summary does not show the makefiles and MSVC project files that are also generated.
NOTE >> Files that are overwrite-protected are generated with a “.sample” extension if a file exists in the output directory of the same name. See “Overwrite Protection.”
Table 5 – Files generated for WeatherSummary example 
Directory
Files
Description
WeatherSummaryExample/
WeatherSummaryExample.xml
The project file defining all project elements (options, configurations, schemas, WSDL files, etc.). See “The Project File” .
    app/
        client/
WeatherSummaryClient.cpp
WeatherSummaryNotificationImp.cpp
WeatherSummaryNotificationImp.h
Sample client implementation using the client proxy. Overwrite-protected.
        data/
WeatherSummary_types_main.cpp
Sample application file.Overwrite protected.
        server/
WeatherSummaryImp.cpp
WeatherSummaryImp.h
Sample service implementation and header files.
    codegen/
        client/
WeatherSummaryNotificationBase.cpp
WeatherSummaryNotificationSkeleton.cpp
WeatherSummaryProxy.cpp
Source files for client-side classes
        data/
            wsx/
WeatherSummary.cpp
WeatherSummaryMarshal.cpp
The implementation files for the datatype WeatherSummary and its marshaler. See Chapter 6 for more information on complex datatypes.
        etc/
WeatherSummaryExample-manifest.xml
Manifest file containing marshalling configuration file for any generated datatypes.
        server/
WeatherSummaryBase.cpp
WeatherSummarySkeleton.cpp
WeatherSummaryNotificationProxy.cpp
Implementation files for the class that handles messaging and the base class for the server-side implementation.
    conf/
transports.xml
client-transports.xml
Server and client transport configuration.
 
client-handlers.xml
Client-side handler configuration. Defines default client logger.
 
weather_handlers.xml
Server-side handler configuration.
 
weather_objects.xml
All named objects required by this service. These are registered and created when the Agent is started.
 
weather_web.xml
Deployment XML file for the service.
    docs/
index.html
The generated documentation. Use index.html as the entry point to all docs contained in the docs subdirectories.
     include/
 
Header files, as follows:
         WeatherSummaryExample/
Subdirectory based on project name.
 
WeatherSummaryBase.h
Base class for the server-side implementation.
 
WeatherSummaryProxy.h
Client proxy class.
 
WeatherSummarySkeleton.h
Class that handles messaging.
 
WeatherSummaryNotificationBase.h
Base class for the notification client-side implementation.
 
WeatherSummaryNotificationProxy.h
Notification proxy on the server side.
 
WeatherSummaryNotificationSkeleton.h
Class that handles messaging for the notification.
 
WeatherSummary_typesConverter.h
Conversion utility class (converts the simple types defined in the datamap to and from the underlying string class, string).
            wsx/
WeatherSummary.h
Datatype class.
 
WeatherSummaryMarshal.h
Datatype marshaling class.
The same as for all projects, by default the code generation includes HTML documentation for all generated code, located in the docs subdirectory of the output directory.
For a discussion of the complex type WeatherSummary.cpp generated above, see Chapter 6 .