Hello Paulo,
From your description, you want to use the "Global.asa x" application_Err or
event to capture unhandled exceptions for your webservices, and you also
want to compile the global.asax's codebehind class into the assembly
together with those webservcie classes, correct?
Based on my understanding, the Application_Err or event is only used for
ASP.NET web page applications to capture unhandled exceptions. As for
webservice, it has different server-side processhandler and the
global.asax's Application_Err or event won't work for webservice
applications. For ASP.NET webservice, you can use a custom SOAPExtension
to inspect any exception info from the SOAP message:
#User Friendly ASP.NET Exception Handling
http://www.codeproject.com/aspnet/AS...df=100&forumid
=94435&exp=0&se lect=1293419
However, I notice that you said the webservice will be used in a windows
service host also. Are you using some custom webservice hosting component
like WSE for the windows host application? for such component like
Global.asax for SoapExtension, they can only be used in ASP.NET
application host, other out of box host(windows service or winform ...) can
not use them.
BTW, since SOAP Extension can be configured at client side web service
proxy also, if you want to capture exception info at client-side, you can
consider write a SOAP Extension and use it for your webservice's client
proxy.
#SoapExtension Class
http://msdn2.microsoft.com/en-us/lib...rotocols.soape
xtension.aspx
Please feel free to let me know if there is anything I missed or if you
have any other consideration.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.