Before building this example, copy all provided sample files from <installdir>\tutorials\webservices\WeatherSummary to the new WeatherSummaryExample directory, allowing the provided files to overwrite the generated files, as follows:
WeatherSummaryClient.cpp | Copy to WeatherSummaryExample\app\client |
WeatherSummaryImp.cpp | Copy to WeatherSummaryExample\app\server |
From a command prompt, navigate to the WeatherSummaryExample directory, and build and run the example as usual.
To compile the client and server, run nmake (Windows) or make (Linux or UNIX) on the makefile in the output directory.
To deploy the server, shut down the Agent servlet container, run nmake (Windows) or make (Linux or UNIX) for the deploy target, and restart the server. The command sequence to deploy the server is shown below:
Win32 | %RWSF_HOME%\rwsfserver stop nmake deploy %RWSF_HOME%\rwsfserver start |
UNIX/Linux | $RWSF_HOME/bin/rwsfserver stop make deploy $RWSF_HOME/bin/rwsfserver start |
Run the client by entering:
prompt> WeatherSummaryClient
HydraExpress's generated client sample implementations all point to the project-directory\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.
If the server and client are implemented as shown above, running the client produces the following output (slightly modified to fit on the page):
Starting listener. Marshaling WeatherSummary received from server: <wsx:WeatherSummary xmlns:wsx= "http://www.roguewave.com/webservices/examples/WeatherSummary.xsd"> <zipcode>97330</zipcode> <windSpeed>5</windSpeed> <sky>clear</sky> <temp>72</temp> </wsx:WeatherSummary> Marshaling WeatherSummary sent to server as one-way message: <wsx:WeatherSummary xmlns:wsx= "http://www.roguewave.com/webservice/examples/WeatherSummary.xsd"> <zipcode>97584</zipcode> <windSpeed>12</windSpeed> <sky>overcast</sky> <temp>54</temp> </wsx:WeatherSummary> Marshaling WeatherSummary received from server as a notification message: <wsx:WeatherSummary xmlns:wsx="http://www.roguewave.com/webservice/examples/WeatherSummary.xsd" xsi:type="wsx:WeatherSummary" xmlns:xsi="http://www.w3.org/2001/ XMLSchema-instance"><zipcode>97584</zipcode><windSpeed>12</windSpeed> <sky>overcast</sky><temp>54</temp></wsx:WeatherSummary> Printing renewal notice received from server: "Your subscription has expired. Do you want to renew?" Sending the following renewal response: "Absolutely! Sign me up for another month." Shutting down Listener.
© 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.