In this section, we will use the following steps to generate code from the HelloWorld.wsdl file.
Set up your environment as described in Chapter 2, "Setup," in the Introduction to HydraExpress.
Open a command prompt, and change to the <installdir>\tutorials\webservices\HelloWorld directory, as shown below:
Win32 |
cd %RWSF_HOME%\tutorials\webservices\HelloWorld |
UNIX/Linux |
cd $RWSF_HOME/tutorials/webservices\HelloWorld |
Generate code by running rwsfgen with the name of the WSDL file and the project name.
prompt> rwsfgen -projectname HelloWorldExample HelloWorld.wsdl
Note: You may also generate code using as a sole argument the provided HydraExpress project file example-project.xml, as follows:
prompt> rwsfgen example-project.xml
Using this file results in exactly the same generated code as the above invocation. For more information on the use of HydraExpress project files in the shipped examples, see Section 1.5.1, "The Use of the HydraExpress Project File in Shipped Examples," in the Introduction to HydraExpress.
HydraExpress creates a project titled HelloWorld including client and service-side code, client and service sample applications, makefiles and MSVC project files, and places all files into the specified code generation directory HelloWorldExample.
These files are generated into several subdirectories, according to HydraExpress's standard code generation directory hierarchy. For more information on the directory structure, see Section 21.3, "The Code Generation Directory." Table 2 lists the generated files for the Hello World example.
HydraExpress supports only file paths without spaces, so when creating your directory names and structure, do not include spaces.
Files that are overwrite-protected will be generated with a ".sample" extension if a file exists in the output directory of the same name. See Section 20.7, "Overwrite Protection."
Directory | Files | Description |
HelloWorldExample/ |
HelloWorldExample.xml | The project file defining all project elements (options, configurations, schemas, WSDLs, etc.). See Section 21.2. |
|
makefile | Project-level makefiles. These call all makefiles in subdirectories. Overwrite-protected. |
|
makefile.include | Include makefile. Contains all makefile compiler and linker options. Edits to this file cascade down to all makefiles. Overwrite-protected. |
|
HelloWorldExample.dsw or | MSVC 6 workspace or MSVC 7 solution files. Generated for Windows platforms, depending on value of -projectversion flag. See Section 20.6. |
|
deployDebug.bat deployRelease.bat | Convenience debug and release deployment batch files generated for use with MSVC projects. |
app/ |
makefile | Makefiles. Builds contents of app/ directory. Overwrite-protected. |
/client |
GreetingPortClient.cpp | Sample client implementation using the client proxy. Overwrite-protected. |
|
makefile | Makefiles. Builds contents of app/client directory. Overwrite-protected. |
|
[GreetingPortClient.dsp or | MSVC6 or MSVC7 project files generated for Windows platforms. |
/server |
GreetingPortTypeImp.cpp GreetingPortTypeImp.h | Sample service implementation and header files. Derives from |
|
makefile | Makefiles. Builds contents of app/server directory. Overwrite-protected. |
|
[<GreetingPortService.dsp or | MSVC6 or MSVC7 project files generated for Windows platforms. |
codegen/ |
makefile | Makefiles for codegen directory. Overwrite-protected. |
/client |
GreetingBindingProxy.cpp | Implementation file for the generated client proxy class |
|
makefile | Makefiles. Builds contents of codegen/client directory. Overwrite-protected. |
|
[<GreetingBinding.dsp or | MSVC6 or MSVC7 project files generated for Windows platforms. |
/server |
GreetingBindingSkeleton.cpp GreetingPortTypeBase.cpp | Implementation files for the class that handles messaging and the base class for the server-side implementation. |
|
makefile | Makefiles. Builds contents of codegen/server directory. Overwrite-protected. |
|
[GreetingPortService.dsp or | MSVC6 or MSVC7 project files generated for Windows platforms. |
conf/ |
server-transports.xml client-transports.xml | Configuration files for: |
|
helloworld_handlers.xml | 2. Server-side handlers to support handler chaining and configuration |
|
client-handlers.xml | 3. Client-side handlers containing default client logger |
|
helloworld_objects.xml | 4. Server-side named objects required by this service. These are registered and created when the container is started. |
|
client-objects.xml | 5. Client-side named objects. |
|
helloworld_web.xml | 6. Deployment XML file for the service. |
|
makefile | Deployment makefiles. Overwrite-protected. |
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: |
/HelloWorldExample | subdirectory <projectname> | |
|
GreetingBindingProxy.h | Client proxy class |
|
GreetingBindingSkeleton.h | Class that handles messaging |
|
GreetingPortTypeBase.h | Base class for the server-side implementation. |
The generator also produces HTML documentation. The generator may produce other support files. The generator uses the support files while generating code, but the files are not required for compiling and running the generated code.
For other Web services, additional files may be generated; see Chapter 20, "The HydraExpress Code Generator," for more information on topics such as generating with datatypes, faults, and using multiple WSDL and XML Schema files.
© 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.