Before building this example, copy the provided sample implementation files from the <installdir>\tutorials\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 |
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 workspace (MSVC 6) or solution (MSVC 7) file, as described in Section 3.5.1.2.
Make sure that you have set up your environment as described in Chapter 2, "Installation" in the HydraExpress User's Guide. On Windows, be sure you have set up your command window with the MSVC environment.
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.
On Windows, you can compile code through MSVC projects. Double-click on the workspace or solution to open it in MSVC, then 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.
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.
To deploy the service, follow the steps in this section.
Make sure that you have set up your environment as described in Chapter 2, "Installation," in the HydraExpress User's Guide. On Windows, be sure you have set up your command window with the MSVC environment.
If the Agent servlet container is currently running, stop it by running the rwsfserver stop command in the RWSF_HOME\bin directory, as shown below:
Win32 |
%RWSF_HOME%\bin\rwsfserver stop |
UNIX/Linux |
$RWSF_HOME/bin/rwsfserver stop |
Run nmake (Windows) or make (UNIX or Linux) at the command prompt with the target deploy. 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.
Win32 |
nmake deploy |
UNIX/Linux |
make deploy |
Restart the container to load the new service. To restart the container, run the rwsfserver start in the RWSF_HOME\bin directory, as shown below:
Win32 |
%RWSF_HOME%\bin\rwsfserver start |
UNIX/Linux |
$RWSF_HOME/bin/rwsfserver start |
If you compiled the Web service with an MSVC project file on Windows platforms, deploy the servlet as follows:
Stop the Agent servlet container, if necessary, as described in the previous section.
Run the deployment batch file generated in the top level code generation directory as a convenience: deployDebug.bat or deployRelease.bat.
Start the Agent servlet container as described in the previous section.
To test the service, just invoke the client from the ...\HelloWorldExample\bin directory:
prompt> GreetingPortClient
The above implementation returns the following response:
Server Response: Hello World!
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.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.