Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Web Service Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

14.3 The Message Handler API

HydraExpress provides an API for creating your own handlers. The classes in this API are implemented in the Web Services Library and are described in the HydraExpress C++ API Reference Guide. Table 8 describes the classes that are the most important for creating custom message handlers.

Table 8: The Message Handler SDK Classes for Creating Custom Handlers 

Class NameDescription

rwsf::CallInfo

This class acts as a container for all of the data associated with a particular service request. It holds the request and response SOAP messages, and provides access methods for metadata such as SOAP headers, transport headers, and session information.

rwsf::MessageProperties

This is the base class for rwsf::CallInfo. This class is important because rwsf::CallInfo inherits a number of important methods from it, such as the isRequest() and isClient() methods described above.

rwsf::MessageHandlerImp

This class provides the interface for processing messages. This is the class your custom message handlers should derive from. As implied by the Imp at the end of the class name, the message handler SDK conforms to the handle/body design pattern.

Figure 8 shows the relationship between the message handler SDK and the generated classes. Note that all of Web service-related classes generated by HydraExpress are essentially message handlers. The two handlers that appear by default in <serviceName>handlers.xml, MyServiceImp and MyServiceSkeleton, both derive (through intermediaries) from rwsf::MessageHandlerImp, as will your custom message handlers.

Figure 8: Message Handler SDK Generated Classes Architecture

The file <servicecontextname>_handlers.xml is generated and initially contains a pointer to the service implementation and the SOAP message handler skeleton. Section 14.5 discusses using this file to configure and chain handlers. The file client-handlers.xml is also generated. In the request-response and one-way message patterns it supports only the logger handler. In the notification and solicit-response message patterns it is similar to <servicecontextname>_handlers.xml, with configuration elements for transport, request, response, and fault handlers. For information on the notification pattern, see Chapter 9, "Introduction to Message Patterns." For information on the solicit-response pattern, see Section 9.2.5, "The Solicit-Response Pattern."

To create your own handler, just derive directly from rwsf::MessageHandlerImp and add pointers to your handlers in <servicecontextname>_handlers.xml. For more information, see Section 14.4, "Creating Your Own Handlers."



Previous fileTop of DocumentContentsIndex pageNext file

© 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.