locked
How to track and audit every call to web service RRS feed

  • Question

  • User769707525 posted
    I have an webservice.sln and one of my application call that web methods in many of the asmx.cs files in the webservice.sln Say (Save and Update Web Methods in each of the asmx.cs pages). I want to audit these method calls. Is there a generic way to put this audtitMethod() instead of putting it in all the Save and Update methods IN EACH ASMX.CS FILES?
    Tuesday, October 17, 2017 5:17 AM

All replies

  • User1168443798 posted

    Hi shishir1986,

    Could you share us a simple webservice.sln project and an implementation of putting audtitMethod in all the Save and Update methods IN EACH ASMX.CS FILES? Then we could try to simplify it.

    It seems you have multiple asmx web service in your service project solution, and you want to add a common method for every web service. If so, you could add a basic service class like below, and inherit it from basic service. Then the added service will contain the basic method.

    Basic Service

        public class BasicService : System.Web.Services.WebService
        {
    
            [WebMethod]
            public string CommonFun()
            {
                return "Common Function";
            }
        }
    

    Other Service

        public class WebService1 : BasicService
        {
    
            [WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }
        }
    

    Best Regards,

    Edward

    Wednesday, October 18, 2017 5:01 AM