I know with ASP.NET there's a global handler Application_EndRequest handler where I could change the Context.Response.StatusCode, and set it to 200 which is my desire.
Now with asmx Web Services, I'm not really sure where I'd put this logic in. I know I'm definitely not interested in writing an ISAPI Filter, and I'm not really running in the ASP.NET environment so HTTPModule is probably useless to me as well.
Any suggestions. Would running this in WCF provide me a simpler mechanism for setting this on a web service?
While I can not imagine why you need this :), you can try using the WebService.HttpContext.Response and set the status code there.
Also, I'm not sure, but Global.asax event handlers are executed even with web service requests, so you may be able still to use what you want there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With