简体   繁体   中英

How to intercept with WCF Web Method Requests?

I have a WCF service (.svc file) which is hosted in IIS and that's not RESTful. It has some web methods with input parameters.

<%@ ServiceHost Language="C#" Debug="true" Service="MyNameSpace.MyService"%>

Each web methods has an input parameter called sitename such as:

List<string> GetAvailableList(string param1, string sitename);

Now I'd need to log the input url and input parameters of the web methods without going there and changing any implementation of the web methods.

Is there anyway, like HTTPModule in ASP.NET, that I can intercept requests/input parameters and log them?

Could I create a .dll and deploy it to the IIS so that it logs/intercepts the requests automatically?

Basically, I'd like to know how many requests are coming in from each sitename.

Hope this help

Message Inspectors - A message inspector is an extensibility object that can be used in the service model's client runtime and dispatch runtime programmatically or through configuration and that can inspect and alter messages after they are received or before they are sent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM