We are starting to develop web services using Axis2 v1.5 with JAX-WS
annotations.  We'd like to set up JAX-WS handlers using the @HandlerChain
annotation but I can't seem to get the handler(s) to fire.  No matter where
I put handlers.xml in my .aar it never falls into
AuthenticationSOAPHandler.handleMessage().  What am I missing?  My code is
as follows:

//My web service class
@HandlerChain(file="handlers.xml", name="handlers")
@WebService(serviceName="MyService")
public class MyService {

        @WebMethod
        public int add(int a, int b) {
                return a + b;
        }
}

//My handlers.xml
<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <javaee:handler-chain name="handlers">
        <javaee:handler>
           
<javaee:handler-name>AuthenticationSOAPHandler</javaee:handler-name>
           
<javaee:handler-class>com.test.ws.AuthenticationSOAPHandler</javaee:handler-class>
        </javaee:handler>
    </javaee:handler-chain>
</javaee:handler-chains>

//AuthenticationSOAPHandler class
public class AuthenticationSOAPHandler implements
SOAPHandler<SOAPMessageContext>{

    public boolean handleMessage(SOAPMessageContext context) {
        return true;
    }

    public boolean handleFault(SOAPMessageContext context) {
        return false;
    }

    public Set<QName> getHeaders() {
        return null;
    }

    public void close(MessageContext context) {
        //Clean up any resources here
    }
}

-- 
View this message in context: 
http://www.nabble.com/Axis2%2C-Jax-WS%2C-and-%40HandlerChain-tp25370562p25370562.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to