Thanks for your reply. Actually i want to Log Errors in the Web Service using HttpModules which is quite possible. So i also wanted to log in which function the error has occured. So i wanted to know function name..
<div>Note When an unhandled exception occurs in an ASP.NET Web service, the <div class="tt">Error</div> event is not bubbled up to HTTP modules and thus ELMAH. Rather, it is intercepted by the ASP.NET runtime and
a SOAP fault is returned to the client. To have an error logged in a Web service, you would need to create a
SOAP Extension that listened for SOAP faults.</div> <div> </div> <div> </div> <div>It can not be done using ELMAH rather not that much simple and easy -:). and is possible using SOAP Extension,
can somebody please provide me simple example code. I find it hard that's provided in above link of SOAP Extension.</div> <div> </div> <div>Thanks</div>
jaspreet.sin...
Member
16 Points
16 Posts
How to know function name being called in Web Service registered with HttpModule
Oct 26, 2011 10:52 AM|LINK
Hello,
How i can know the function name that is being called in Web Service , in the HttpModule.
Also i have created a web service and created an HttpModule . Registered Web Service with HttpModule.
How i can get the function name that is being called by user in HttpModule.
I have put code in Init method of Httpmodule and also registered with begin request event as below:
public class MyClass:IHttpModule
{
public void Init(HttpApplication context)
{
context.BeginRequest+=new EventHandler(context_BeginRequest);
}
public void context_BeginRequest(Object s, EventArgs e)
{
}
|
Thanks
rsarangapany
Member
174 Points
29 Posts
Re: How to know function name being called in Web Service registered with HttpModule
Oct 26, 2011 03:59 PM|LINK
Hi,
What you are trying to achive can only be done using AOP (Aspect oriented programming). It cannot be done using httpmodules.
Its a classic cross cut concern, which involves method interecption.
C# and .net do not support this out of the box, but there are many 3rd party frameworks out there which allow you to achive this.
.net has been designed to support this feature in the future. It can easily be achived by using attributes on classes and methods.
But when and if they will ever get around to including it in the framework is not sure.
For now you are better of using a established 3rd party library. Some require a licence some are free.
Here are some links.
http://www.developerfusion.com/article/5307/aspect-oriented-programming-using-net/3/
http://www.sharpcrafters.com/
jaspreet.sin...
Member
16 Points
16 Posts
Re: How to know function name being called in Web Service registered with HttpModule
Oct 27, 2011 09:21 AM|LINK
Hello,
Thanks for your reply. Actually i want to Log Errors in the Web Service using HttpModules which is quite possible. So i also wanted to log in which function the error has occured. So i wanted to know function name..
thanks.
rsarangapany
Member
174 Points
29 Posts
Re: How to know function name being called in Web Service registered with HttpModule
Oct 27, 2011 11:07 AM|LINK
Oh my bad then, in that case things work out much easier.
What your are requesting to do is known as ELMAH's Architecture.
There are some well know ways to implement this.
Here's MSDN write up on it. http://msdn.microsoft.com/en-us/library/aa479332.aspx
jaspreet.sin...
Member
16 Points
16 Posts
Re: How to know function name being called in Web Service registered with HttpModule
Oct 27, 2011 06:30 PM|LINK
Hello,
There is a note given in above link :