What are JAX-WS Interceptors (also known as handlers)?
Asked Answered
I

3

6

What are JAX WS Interceptors? Where do I find info regarding the same!

Innsbruck answered 9/9, 2009 at 8:39 Comment(0)
A
17

JAX-WS interceptors (also called handlers) are used to weave in aspects of the request in a transparent way. Example of this are logging or requests/responses, adding security headers to the message, encryption, compression, etc. A single interceptor can manipulate either the logical payload (content) of the message or the protocol of the message, but cannot do both.

See here for the introductory documentation on them.

Amarelle answered 24/12, 2009 at 13:11 Comment(1)
Note that, properly speaking, interceptors are not part of JAX-WS. JAX-WS defines/uses only handlers. CXF from Apache, while implementing JAX-WS, also provides interceptors as an additional mechanism. So, interceptors are not exactly the same than handlers.Vanguard
C
6

Handlers are basically similar to filters, but for inboud and output processing of SOAP messages. Here is a quick tutorial I found.

Cardon answered 9/9, 2009 at 8:46 Comment(0)
P
1

in addition to a Handler in JAX-WS, the RI also provides the Tube concept. It is pretty close to the Filter concept in a Servlet API, as such you can access and manipulate entire in/out packet for a service and a client alike.

I find it more handy for general purposes, like logging of messages and prevalidation of soap headers, etc just because I dont have to attach a @HandlerChain on every web-service. See link.

Tube based message logging

Pickaxe answered 10/7, 2017 at 6:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.