JAX-WS Handlers

As an alternative to the @HandlerChain annotation, JAX-WS Handlers can be added to both your client or server via application.properties:

# A web service endpoint with multiple Handler classes

# A web service client with a single Handler

Where MySOAPHandler could look like below:

import jakarta.xml.ws.handler.soap.SOAPHandler;
import jakarta.xml.ws.handler.soap.SOAPMessageContext;

public class MySOAPHandler implements SOAPHandler {

    public boolean handleMessage(SOAPMessageContext messageContext) {
        SOAPMessage msg = messageContext.getMessage();
        return true;
    // other methods
The SOAPHandler classes will be attempted to be loaded via CDI first. If no CDI beans are available for the given type, then the no parameters constructor will used to instantiate each class.