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

3.5 Compiling and Running the Application

Before building this example, copy the provided sample implementation files from the <installdir>\examples\webservices\HelloWorld to the new HelloWorldExample directory, allowing the provided files to overwrite the generated files, as follows:

GreetingPortClient.cpp

Copy to HelloWorldExample\app\client

GreetingPortTypeImp.cpp

Copy to HelloWorldExample\app\server

3.5.1 Compiling the Application

From a command prompt, navigate to the HelloWorldExample directory, and build and run the example as described below.

The code generator creates makefiles for building the server and client code. To build the server from the command line using the makefiles, go to Section 3.5.1.1.

If you are on Windows, you can also build the server using the generated solution (.sln) file, as described in Section 3.5.1.2.


Make sure that you have set up your environment as described in Chapter 2, "Setup," in the HydraExpress User Guide. On Windows, be sure you have set up your command window with the MSVC environment.

3.5.1.1 Compiling Using the Makefile

From a command prompt, change to the directory HelloWorldExample, and simply run nmake (Windows) or make (UNIX or Linux) at the command prompt.


If you wish to build just the client or server, the top-level makefile accepts a server or client target.

The makefile builds any components created when the generator created the makefile, placing them into top-level bin and lib directories.

3.5.1.2 Compiling Using MSVC

On Windows, you can compile code through MSVC projects. Double-click on the solution to open it in MSVC. Build by selecting the appropriate item from the Build menu, or by right-clicking on the item you wish to build and selecting the appropriate item from the pop-up menu.

3.5.2 Deploying the Service

The generated makefile includes a deploy target to deploy the sample service. If you have compiled the service using MSVC on Windows, a deployment batch file is generated for your convenience. The deploy step is not run automatically, so be sure to run the deploy target when you are ready to deploy your service to the Agent.

3.5.2.1 Deploying with the makefile

To deploy the service, follow the steps in this section.


Make sure that you have set up your environment as described in
Chapter 2, "Setup," in the HydraExpress User Guide. On Windows, be sure you have set up your command window with the MSVC environment.

  1. If the Agent is currently running, stop it by running the rwsfserver stop command, as shown below:

    Windows rwsfserver stop

    UNIX/Linux rwsfserver stop

  2. Run nmake (Windows) or make (UNIX or Linux) at the command prompt with the deploy target. The makefile deploys the service into the HydraExpress installation. The DLLs or shared libraries for the service and client are placed in <installdir>\apps-bin on Windows and <installdir>/apps-lib on UNIX/Linux. The service descriptor for the Hello World service is copied to the Agent deployment directory at <installdir>\apps\servlets\helloworld\WEB-INF.

    Windows nmake deploy

    UNIX/Linux make deploy

  3. Restart the Agent to load the new service by running the rwsfserver start, as shown below:

    Windows rwsfserver start

    UNIX/Linux rwsfserver start

3.5.2.2 Deploying Services Compiled with MSVC Project Files

If you compiled the Web service with an MSVC project file on Windows platforms, deploy the servlet as follows:

  1. Stop the Agent, if necessary, as described in the previous section.

  2. Run the deployment batch file generated in the top level code generation directory as a convenience: deployDebug.bat or deployRelease.bat.

  3. Start the Agent as described in the previous section.

3.5.3 Testing the Service

To test the service, just invoke the client from the ...\HelloWorldExample\bin directory:

The above implementation returns the following response:


HydraExpress's generated client sample implementations all point to the project\conf directory to locate the client configuration files. If you move the client executable without maintaining the same code generation directory structure, or you invoke the client from another location, be aware that you must edit the client implementation to maintain the correct path to the conf directory.



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.