CXF is a web service framework for java. We've successfully developed clients (consumers) and services using it. The official website is at cxf.apache.org.
Interceptors can listen to incoming or outgoing messages. The CXF library can be used as both client and server, so an outgoing message from a client may be considered in incoming message on the server.
AbstractPhaseInterceptor is the base class, handleMessage() must be implemented, and optionally handleFault() can be overridden. If there is a fault, then inside handleFault(), you can access details via
Exception exception = message.getContent(Exception.class); Throwable cause = exception.getCause();
An example of an interceptor is a custom logger.
The phase must be chosen as part of the interceptor's construction. Look at the Phase class for a valid phase name, and refer to CXF Interceptors documentation for a description of the various phases.
Get a handle on the request or response objects using the following snippet:
a javax.xml.ws.Holder maybe used for objects used for both request and response.