title: How to exclude method from CXF WebService - strange behavior
body: <p>Can someone explain to me the following behavior of CXF?</p>
  
  <p>I have simple WebService:</p>
  
  <pre class="lang-java prettyprint-override"><code>import javax.jws.WebMethod;
  
  public interface MyWebService {
  
      @WebMethod
      String method1(String s);
  
      @WebMethod
      String method2(String s);
  
      @WebMethod(exclude = true)
      String methodToExclude(String s);
  
  }
  </code></pre>
  
  <p>I want to have my <code>methodToExclude</code> in interface (for Spring), but I do not want to have this method in generated WSDL file. The code above does exactly that.</p>
  
  <p>But when I add <code>@WebService</code> annotation to the interface I get error:</p>
  
  <pre class="lang-java prettyprint-override"><code>import javax.jws.WebMethod;
  import javax.jws.WebService;
  
  @WebService
  public interface MyWebService {
  
      @WebMethod
      String method1(String s);
  
      @WebMethod
      String method2(String s);
  
      @WebMethod(exclude = true)
      String methodToExclude(String s);
  
  }
  </code></pre>
  
  <blockquote>
    <p>org.apache.cxf.jaxws.JaxWsConfigurationException: The @javax.jws.WebMethod(exclude=true) cannot be used on a service endpoint interface. Method: methodToExclude</p>
  </blockquote>
  
  <p>Can someone explain this to me? What's the difference? Also I'm not sure if it will work fine later, but I didn't find the way how to exclude the <code>methodToExclude</code> when I use <code>@WebService</code>.</p>