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.

链接地址: http://www.djcxy.com/p/60430.html

上一篇: 按特定顺序调用Web服务方法

下一篇: 如何拦截WCF Web方法请求?