Using JAX-WS handlers with HTTP Binding Component
In JAX-WS, there is the concept of handlers
which are really interceptors to inject application logic to alter the protocol or payload messages before and/or after service
invocations. These are application level implementations which can be invoked at strategic places to extend the message processing capabilities.
Check this out for more elaborate overviews of the JAX-WS handlers.
How to enable JAX-WS handlers in OpenESB
In OpenESB, we allow user handler implementations to be plugged into JAX-WS runtime through HTTP BC. A few things worth mentioning are:
- Handler implementation can be implemented in Java SE project(s) or any other standalone environment, i.e. handler implementation(s) can also be compiled outside of the IDE.
- Handler is an user implemented class with the only requirement of implementing the well-defined JAX-WS handler interface (SOAPHandler, LogicalHandler, and the optimized version of the SOAPHandler called MessageHandler)
- Handler implementation and configuration does not affect the application composition, i.e. building a BPEL process which adds a webservice request message
handler to tweak the SOAP headers before invoking a remote service should/would not affect the BPEL logic.
- Handler configuration, i.e. the particular handler class to invoke, will be done on the SOAP binding in CASA editor
How to configure JAX-WS handlers in OpenESB
As mentioned earlier, handlers can be configured on the SOAP binding in CASA. Since it is a port (endpoint) level configuration, the handler configuration is enabled on the SOAP endpoint icon (i.e. the "greenish" and the "pupleish" arrows), as shown in the screen shot below: