ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
Is it the ASMX or the AJAX JavaScript which is throwing the exception?
If it's the Javascript, you'll need to write exception handling into your JS, and then push that back to the server to be tracked in your error datastore--possibly via another call to your webservice.
If it's the ASMX then it's probably getting caught by your Application_Error, BUT as ASMX returns XML or JSON it won't necessarily get displayed on your UI unless you're looking for it.
Basic problem (well it is not a problem) with ASMX web service is that any exception behind the service layer is thrown as SOAP exception to client. You need to catch SOAP exception and then look for inner exception there.
A better and clean approach is you implement SOAP handler in your application. Serialize the SOAP exception through this and on client end deserialize it. This way you will have complete control over exception flow, rather than .net framework.
HTH
Client-side I Would simply wrap your call to the service in a JavaScript. On the server-side the error should be logged in your server log as an. http 500 error