Add the Handlers to the Proxy
The client proxy is itself a handler, and also supports chaining handlers. For general information on how to use the client proxy, see Chapter 7, Developing Clients.
To add new handlers to the proxy, just invoke the appropriate “add handler” methods on the proxy after you call the make() method. Following is an excerpt from the supplied implementation of the proxy, HandlersClient.cpp.
HandlersProxy proxy = HandlersProxy::make(location);
proxy.addTransportHandler(new StringReverseHandler);
proxy.addServiceRequestHandler(new SoapSecurityHandler);
The order in which handlers are processed on the client affects which type of handlers you choose to add:
*Transport handlers are applied symmetrically, with the first handler added being closest to the transport in both directions. A second transport handler would be one position removed from the transport in both directions, and so on.
*Request and response handlers are applied in the order added.
This is illustrated in Figure 8.