We have a web service within the same project as a SiteCore 7.2 web site.
If the web service encounters an Exception, it needs to return a Response.StatusCode of InternalServerError.
Context.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
I then have tried calling Response.End() and ApplicationInstance.CompleteRequest() but in both cases the web service is returning a 404 error. I'm guessing this is SiteCore getting involved in the pipeline and redirecting somewhere else.
In this case we want the web service to function independently of SiteCore and return the InternalServiceError