title: how to imlement a SOAP handler in JAX-WS client
body: <p>I'm triing to implement a SOAP Handler to a client. I'm using Wildfly8.2 java8 and JAX-WS and Maven</p>
  
  <p>I have generated the client interface class with eclipse from the endpoint WSDL</p>
  
  <p>The handler-chain.xml file is placed in the same package as the client interface. </p>
  
  <p>When I call the web service it executes ok but the handler is not invoked. If I put a brake point in the handler it is never invoked</p>
  
  <p>the client interface is like this:</p>
  
  <pre><code>@WebService(targetNamespace = "********************", name = "WorkflowEditor")
  @XmlSeeAlso({ ObjectFactory.class })
  @HandlerChain(file = "handler-chain.xml")
  public interface WorkflowEditor {
  </code></pre>
  
  <p>I have tried also to put the xml in resources and call it in the annotation with the url I verified is working for example :</p>
  
  <pre><code>    @WebService(targetNamespace = "**************", name = "WorkflowEditor")
  @XmlSeeAlso({ ObjectFactory.class })
  @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  @HandlerChain(file = "http://cloudflow-backend-local.arctur.net:8080/resources/handler-chain.xml")
  public interface WorkflowEditor {
  </code></pre>
  
  <p>the handler is like this:</p>
  
  <pre><code>package si.arctur.services.handlers;
  
  import java.util.Set;
  
  import javax.xml.namespace.QName;
  import javax.xml.soap.SOAPMessage;
  import javax.xml.ws.handler.MessageContext;
  import javax.xml.ws.handler.soap.SOAPMessageContext;
  
  public class PrintEnvelopeHandler implements javax.xml.ws.handler.soap.SOAPHandler&lt;SOAPMessageContext&gt; {
  
      @Override
      public boolean handleMessage(SOAPMessageContext context) {
          System.out.println("Client : handleMessage()......");
          SOAPMessage soapMessage = context.getMessage();
          return true;
      }
  
      @Override
      public boolean handleFault(SOAPMessageContext context) {
          System.out.println("Client : handleFault()......");
          return true;
      }
  
      @Override
      public void close(MessageContext context) {
          System.out.println("Client : close()......");
      }
  
      @Override
      public Set&lt;QName&gt; getHeaders() {
          // TODO Auto-generated method stub
          return null;
      }
  
  }
  </code></pre>
  
  <p>and the handler-chain.xml file is like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;javaee:handler-chains 
   xmlns:javaee="http://java.sun.com/xml/ns/javaee" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;javaee:handler-chain&gt;
  &lt;javaee:handler&gt;
    &lt;javaee:handler-class&gt;si.arctur.services.handlers.PrintEnvelopeHandler&lt;/javaee:handler-class&gt;
  &lt;/javaee:handler&gt;
   &lt;/javaee:handler-chain&gt;
  </code></pre>