title: Camel HTTP_RESPONSE_CODE setup
body: <p>I'm trying to handle exception in my route which was thrown by my soap endpoint with onException. I need to implement some custom logic to map SOAP exeption to certain HTTP response headers.</p>
  
  <p>When I use</p>
  
  <pre><code> setHeader(Exchange.HTTP_RESPONSE_CODE, constant(502)).
  </code></pre>
  
  <p>directly in my route definition, the header is setup fine. However my custom logic cannot be implemented. </p>
  
  <p>I tried to setup header in processor </p>
  
  <pre><code>exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "502");
  </code></pre>
  
  <p>but it is ignored and system concuming my resoponse recieves HTTPCode = 200.
  Full routing code is below:</p>
  
  <pre><code> rest().post("/mypost")                
              .type(MyRequest.class)
              .outType(MyResponse.class)
              .route().routeId("rst_myrest")
              .log(LoggingLevel.DEBUG,"recived: ${body}")
              .to("direct:drt_addData")
              .endRest();
  
   onException(ServiceException.class).
              handled(true).
              setHeader(Exchange.HTTP_RESPONSE_CODE, constant(502)). //i remove this line when using processor header setup
              onExceptionOccurred(serviceExceptionProcessor).
              marshal(new JsonDataFormat(JsonLibrary.Jackson)).end();
  
  
  public class ServiceExceptionProcessor implements Processor{
      @Override
      public void process(Exchange exchange) throws Exception {
          ServiceException request = exchange.getException(ServiceException.class);
          //preparing body, etc
          exchange.getOut().setBody(message, Errors.class);       
          // some logic for defining header response code
          // for example response code is 502
          exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, "502");
  
      }
  }
  </code></pre>
  
  <p>How can I setup header in processor? How does header setup work?</p>