title: Rest WebService error handling
body: <p>I am using RestWebservice for few basic operations , like creating/searching. The request xml looks something like this</p>
  
  <pre><code>&lt;customer&gt; 
      &lt;name/&gt;
    .....
   &lt;/customer&gt;
  </code></pre>
  
  <p>For a successful operation I return the same customer XML with extra fields populated in it(eg. systemId etc which we blank in the request) .
  with Response.Status=2000</p>
  
  <p>For an unsuccessful operation i return something like this with different error codes .
  e.g Response.Status = 422(Unprocessable entity) 
      Response.Status= 500(Internal Server Error) and few others..</p>
  
  <pre><code>&lt;errors&gt;
  &lt;error&gt; An exception occurred while creating the customer&lt;/error&gt;
  &lt;error&gt; blah argument is not valid.&lt;/error&gt;
  &lt;/errors&gt;
  </code></pre>
  
  <p>Now i am not sure , whether this is the correct way of sending the errors to the client. Maybe it should be present in the header of the response.   </p>
  
  <p>I will really appreciate any help.
  Thanks! </p>