title: Change Spring WS Fault status code from 500 to 400
body: <p>I have built Spring WS application (based on Spring WS 2.2.3) that exposes a small web service with couple of Operations. Each Operation receives input parameters to search a backend database and return response. Some of the parameters are mandatory (e.g. Street Name) and the Client have requested that if a request to the service is missing some of these mandatory parameters (e.g. empty Street Name) then my service should return proper SOAP Fault with HTTP status of 400. </p>
  
  <p>My exception handling is working fine and I am able to return the correct SOAP Fault to the client if some a required parameter was missing form the request message and Spring WS takes care of the rest by wrapping a SOAP Fault and sends it back to the client with status code of 500 like the following:</p>
  
  <pre><code>HTTP/1.1 500 Internal Server Error
  Server: Apache-Coyote/1.1
  Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  SOAPAction: ""
  Content-Type: text/xml;charset=utf-8
  Content-Length: 503
  Date: Thu, 10 Dec 2015 22:28:02 GMT
  
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;SOAP-ENV:Header/&gt;
      &lt;SOAP-ENV:Body&gt;
          &lt;SOAP-ENV:Fault&gt;
              &lt;faultcode&gt;SOAP-ENV:Client&lt;/faultcode&gt;
              &lt;faultstring xml:lang="en"&gt;Street Name is required&lt;/faultstring&gt;
          &lt;/SOAP-ENV:Fault&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Which is good except that I really want the HTTP status code to be <strong>'400 Bad Request'</strong> instead of the '<strong>500 Internal Server Error</strong>' I can't figure out how to change the status code from 500 to 400 and get similar response like the following:</p>
  
  <pre><code>HTTP/1.1 400 Bad Request
  Server: Apache-Coyote/1.1
  Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  SOAPAction: ""
  Content-Type: text/xml;charset=utf-8
  Content-Length: 503
  Date: Thu, 10 Dec 2015 22:28:02 GMT
  
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;SOAP-ENV:Header/&gt;
      &lt;SOAP-ENV:Body&gt;
          &lt;SOAP-ENV:Fault&gt;
              &lt;faultcode&gt;SOAP-ENV:Client&lt;/faultcode&gt;
              &lt;faultstring xml:lang="en"&gt;Street Name is required&lt;/faultstring&gt;
          &lt;/SOAP-ENV:Fault&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Any ideas?</p>