Posts

Showing posts with the label Handlers

How To Define Handlers Chain in JAX-WS Using LogicalHandler and SOAPHandler At Same Time

JAX-WS Handlers implement Interceptor Pattern and Chain of Responsibility Pattern, that means when a client sends a SOAP request to a service endpoint, the handles intercept the request, perform some processing and (optionally) forward request to next handler in the chain, until the actual service implementation process the request. A handler may process the request by itself by replying to the service client. It depends how you have implemented the handlers. JAX-WS provides two types of handlers i.e. LogicalHandler and SOAPHandler. In this article I will show have you can define both types of handlers in the a chain and how/when the runtime calls their life cycle method i.e. handleMessage() to provide them opportunity of processing the request. Generally handlers do not process the request, they only perform 'cross cutting concerns' tasks e.g. authentication, authorization, logging, accounting, validation, etc. Let us define a web service, which have only one method. We can al...

Popular Posts