views:

20

answers:

0

I'd like to trap any unhandled exception thrown in an ASP.NET web service, but nothing I've tried has worked so far.

First off, the HttpApplication.Error event doesn't fire on web services, so that's out..

The next approach was to implement a soap extension, and add it to web.config with:

<soapExtensionTypes>
   <add type="Foo" priority="1" group="0" />
</soapExtensionTypes>

However, this doesn't work if you call the web method over JSON (which my web site does exclusively)..

My next idea would be to write my own HttpHandler for .asmx, which would hopefully derive from System.Web.Script.Services.ScriptHandlerFactory and do something smart. I haven't tried this yet.

Is there an approach I'm missing? Thanks!

Mike