Does IHttpModule module work with WCF service,

272 Views Asked by At

I have WCF service. i want each and request to WCF operation be scanned throughthe IHttpModule module. But it not hitting the IHttpModule.

Any help is highly appreciated.

1

There are 1 best solutions below

2
On

HttpModules work with WCF only if you run WCF service in ASP.NET compatibility mode. You can enable ASP.NET compatibility mode either of following way.

  1. Using web.config

    < system.serviceModel> < serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> < /system.serviceModel>

  1. Using attribute

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class Service : IService { // ... }