title: camel spring-ws: handling exception
body: <p>Is there a way to return a custom body (e.g. custom bean) and http status as 500 in camel + spring-ws?</p>
  
  <p>I tried with</p>
  
  <pre><code>onException(RuntimeException.class).handled(true).process(new
       ExceptionProcessor()).marshal(jaxb);
  </code></pre>
  
  <p>and then in the processor
     public class ExceptionProcessor implements Processor {</p>
  
  <pre><code>@Override
  public void process(Exchange exchange) throws Exception {
      RuntimeException e = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, RuntimeException.class);
  
      ExceptionHandler handler = ExceptionHandlerFactory.fromException(e);
      ExceptionType response = handler.handleException();
  
  
      if (exchange.hasOut()) {
          exchange.getOut().setBody(response);
      } else {
          exchange.getIn().getHeaders();
          exchange.getIn().setFault(true);
          exchange.getIn().setBody(response);
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but even if the body is what I want, the http status is always 200. <br>
  Can you help me? </p>
  
  <p>Some more info:
  I'm using camel version  2.20.2</p>