CXF interceptors, CXF features, and JAX-WS handlers
Change how SOAP requests and responses are processed on a client or a service by adding CXF interceptors, CXF features, or JAX-WS handlers, declared with annotations or in application.properties.
Apache CXF processes every message through a chain of interceptors, and a CXF feature packages the interceptors and settings for one capability, such as the built-in LoggingFeature.
JAX-WS handlers are the alternative defined by the JAX-WS specification, implemented as SOAPHandler<SOAPMessageContext> classes.
In every case the class is looked up as a CDI bean first, by fully qualified class name or by bean name, and instantiated through its no-argument constructor only when no bean exists, so your interceptors, features, and handlers can inject other beans.
Where to go
-
CXF Interceptors and Features - Use them when you want the CXF processing model, including the built-in features such as
LoggingFeatureand your own interceptor classes. Interceptors and features attach to a service through the@Features,@InInterceptors,@OutInterceptors,@InFaultInterceptors, and@OutFaultInterceptorsannotations on the service interface or implementation, or through the matchingquarkus.cxf.endpoint."/endpoint-path".*properties (features,in-interceptors,out-interceptors,in-fault-interceptors, andout-fault-interceptors), and to a client through its client configuration. -
JAX-WS Handlers - Use them when you prefer the standard JAX-WS handler API to CXF-specific interceptors. Handlers attach through
quarkus.cxf.endpoint."/endpoint-path".handlersandquarkus.cxf.client."client-name".handlers, as an alternative to the@HandlerChainannotation.