We have a set of web services implemented in JAX-WS and a SOAPHandler
that adds control attributes in the SOAP headers.
Today, we need to add the @HandlerChain
annotation in every new service we create.
The idea is that new services implementors do not need to know that a @HandlerChain
exists.
Is there a way to configure a global Handler
that intercepts all services running in my WAR?
JAX-WS is a technology for building web services and clients that communicate using XML. JAX-WS allows developers to write message-oriented as well as RPC-oriented web services. In JAX-WS, a web service operation invocation is represented by an XML-based protocol such as SOAP.
Tags:jax-ws | server | soap | web services. SOAP handler is a SOAP message interceptor, which is able to intercept incoming or outgoing SOAP message and manipulate its values.
The web service handler is a Java client that can invoke any document-literal web service that is WS-I BP 1.1 compliant. The outbound integration message forms the payload (SOAP body) and the handler provides the SOAP headers and envelope. This handler operates independent of the container.
One option that might work is aspectj. With bytecode weaving (or in conjunction with spring if you'd like) you can create a single handler as an aspect and weave into all classes (and WAR files as well) through maven plugin perhaps. I haven't tried this myself I guess the only challenge would be getting a handle on the SOAP header from the aspect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With