LibraryLink ToToggle FramesPrintFeedback

Handlers: An Introduction

When a service proxy invokes an operation on a service, the operation's parameters are passed to FUSE Services Framework where they are built into a message and placed on the wire. When the message is received by the service, FUSE Services Framework reads the message from the wire, reconstructs the message, and then passes the operation parameters to the application code responsible for implementing the operation. When the application code is finished processing the request, the reply message undergoes a similar chain of events on its trip to the service proxy that originated the request. This is shown in Figure 21.1.


JAX-WS defines a mechanism for manipulating the message data between the application level code and the network. For example, you might want the message data passed over the open network to be encrypted using a proprietary encryption mechanism. You could write a JAX-WS handler that encrypted and decrypted the data. Then you could insert the handler into the message processing chains of all clients and servers.

As shown in Figure 21.2, the handlers are placed in a chain that is traversed between the application level code and the transport code that places the message onto the network.


The JAX-WS specification defines two basic handler types:

The differences between the two handler types are very subtle and they share a common base interface. Because of their common parentage, logical handlers and protocol handlers share a number of methods that must be implemented, including:

The differences between the implementation of a logical handler and the implementation of a protocol handler revolve around the following:

To add a handler to an application you must do the following: