Developing Services
Overview
This chapter presents the various options available for creating a service using HydraExpress. This example complements
Chapter 7, Developing Clients, both of which are based on the provided example DayofWeek located in your
<installdir>\
examples\webservices\DayOfWeek directory.
Chapter 7 generates code to create both a client and server for the DayofWeek example, and discusses the client and options for creating a client. This chapter discusses the service, options for creating a service, and building and testing the service using the client.
The WSDL file DayOfWeek.wsdl defines a single operation, GetDayOfWeek. Since this example focuses on the process of working with the generated components rather than designing an implementation, the service is deliberately simple. The operation receives a message containing an XML Schema date part. The operation returns a message containing an XML Schema string that holds the day of the week on the date provided.
For a basic discussion on generating code, see
Chapter 3, Creating a Web Service.To create a service:
To test the service, use the client as described in
Chapter 7, Developing Clients. Further Options describes additional considerations involved in creating a server suitable for production.
HydraExpress generates three server-side classes:
an abstract base class from which the concrete service implementation derives
a sample concrete service implementation
a SOAP message handling class
The generator overwrite-protects sample implementations, configuration files, and generated makefiles, meaning that subsequent code generations append
.sample to the file if a file of the same name exists in the code generation directory. See
Overwrite Protection.NOTE: If you modify a file with a .sample extension, be sure to remove the extension or rename the file before rerunning the code generator, or your changes will be overwritten.