Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42406

VS 2010 web service to set response.statuscode = 500

$
0
0
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.
"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;

        }

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.

Viewing all articles
Browse latest Browse all 42406

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>