Skip to main content

Understanding Handlers in JAX-WS

Posted by ramapulavarthi on May 1, 2006 at 10:06 AM PDT

JAX-WS provides a pluggable framework to extend the runtime processing capabilities through handlers. Handlers are message interceptors that can do pre-processing/post-processing of the messages to complement your Web Service. JAX-WS defines two types of handlers, logical handlers and protocol handlers. Protocol handlers are specific to a protocol and may access or change the protocol specific aspects of a message. Logical handlers are protocol-agnostic and act only on the payload of the message.

In this article "A little about Handlers in JAX-WS", I explain the differences between logical and SOAP handlers, and show examples to write a simple handler. The following diagram shows the differences in the message context accessible to these handlers.

messagecontext.jpg

The SOAPLoggingHandler shows how one can log inbound and outbound soap messages using a SOAP handler. In the same lines, I showed a LogicalLoggingHandler to show how one can use logical handler to process the payload of the message. The following diagram shows how SOAP handlers and logical handlers plug in to the JAX-WS runtime.

handlers2.JPG

Find more about this in the article. I hope this article helps you in understanding handlers and get you started.

Related Topics >>