Using the Server Implementation
HydraExpress generates a set of classes and XML configuration files to implement the Web service. The C++ source files are generated into the
app\server and
codegen\server directories, and the header files into the
include\DayOfWeekExample directory. Once the service is built, it is hosted by the Agent. (See
Chapter 23, Options for Deploying Services.To implement the server, you need be concerned only with the abstract base class for the server implementation and the sample implementation, which derives from the abstract base class. In this example, these classes are
DayOfWeekPortTypeBase DayOfWeekPortTypeImp To implement the server, either create a class that derives from the generated implementation base class, or implement the methods in the sample implementation. In most cases, modifying the sample implementation is the simplest approach.
This example ships with a server and a client implementation that you can use to quickly compile and run the example. These are discussed below.
The generated header file for the server implementation contains the signatures for the generated methods. Method names match the operation names specified in the WSDL file, with the first letter of the name converted to lower case. Parameter names match the part names in the WSDL with an underscore and the direction of the part appended to the name. For example, an
in part named
tickerSymbol will have the name
tickerSymbol_in, while an
inout part named
targetStruct will have the name
targetStruct_inout. For details on naming convention in the generated code, see
Appendix A.
Although the class declaration for the implementation abstract base class may contain several functions, the derived implementation should override only the pure virtual functions, unless otherwise noted. The sample below shows the relevant declaration in the server implementation header file.