I use RestWebservice for several basic operations such as create / search. The xml request looks something like this:
<customer>
<name/>
.....
</customer>
For a successful operation, I return the same XML client with additional fields added to it (for example, systemId, etc., which we are empty in the request). with Response.Status = 2000
For an unsuccessful operation, I return something similar with different error codes. e.g. Response.Status = 422 (unprocessed object) Response.Status = 500 (Internal server error) and several others.
<errors>
<error> An exception occurred while creating the customer</error>
<error> blah argument is not valid.</error>
</errors>
Now I'm not sure if this is the right way to send errors to the client. Perhaps it should be present in the response header.
I will be very grateful for any help. Thank you