title: Custom Response + HTTP status?
body: <p>I have a rest interface for my project.
  For one class i have a POST method where you can post an xml and i RETURN a <strong>custom response</strong> like:</p>
  
  <p><code>&lt;customResponse&gt;Invalid email&lt;/customResponse&gt;</code></p>
  
  <p>if the email from the xml which was posted, was incorrect + other custom messages i have defined for different situations.</p>
  
  <p>For all of these the HTTP STATUS is automatically put on 200 (OK).
  Is there any way to change it?</p>
  
  <p>Ps: I know that i can throw a web application like : </p>
  
  <pre><code>throw new WebApplicationException(Response.Status.BAD_REQUEST);
  </code></pre>
  
  <p>but in this case my custom response is no more included.</p>
  
  <p>So i just want to return my custom error + 400 as http response.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>UPDATE</strong> after comments:
  My method is:</p>
  
  <pre><code> @POST
   @Path("{membershipExternalId}")
   @Consumes(MediaType.APPLICATION_XML)
   @Produces("application/xml")
   public CustomResponse invite(){ //code}
  </code></pre>
  
  <p>You see that i return my CUSTOM RESPONSE. If i would return simple RESPONSE i could set the STATUS but in this case i cannot see any way.</p>