title: How to catch any exceptions in a SOAP webservice method?
body: <p>I'm offering a <code>SOAP</code> <code>@WebMethod</code> using <code>Spring</code> and  <code>CXF</code>. And I would like to catch any exceptions (checked and unchecked) and transform them to a custom <code>@WebFault</code>.</p>
  
  <p>Can I somehow assign a erro-handler/interceptor to my <code>@WebSerivce</code> class so that I don't have to provide extra <code>try-catch</code> blocks for every webserivce method?</p>
  
  <pre><code>&lt;jaxws:endpoint implementor="de.MyService" address="/MyService" /&gt;
  
  @Component
  @WebService
  public class MyService {
      @WebMethod
      public void test() throws MyException {
          try {
              service.run();
          } catch (Exception e) {
              throw new MyException("test");
          }
      }
  }
  
  
  @WebFault
  public class MyException extends Exception {
      public MyException(String message) {
          super(message);
      }
  }
  </code></pre>
  
  <p>So that with some kind of interceptor, my methods would look like this:</p>
  
  <pre><code>    @WebMethod
      public void test() {
          service.run();
      }
  </code></pre>
  
  <p>Is that possible?</p>