I'm writing a web service which my client (as in a person) is going to be calling. If I encounter a situation where I want to report an error condition on the page, he wants me to set Response.StatusCode = 500.
Here is my extensive code so far:
What "loop over list for checks" means is iterate through the documents he passes me and determine if the user is allowed to order the quantity he has entered. If not, that is when I want to return an error message and set that status code.
Thanks.
"On failure, set status code to 500 and pass back the error message. (Respsonse.StatusCode = 500 something along those lines)"
I don't seem to have a Response object. If I start typing that, intellisense suggests I use HttpResponse, but that doesn't have a StatusCode property.Here is my extensive code so far:
Code:
[WebMethod]
public string CheckAllQuantities(List<Document> documents)
{
// loop over list for checks
return string.Empty;
}
Thanks.