0

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.

user1844634
  • 1,221
  • 2
  • 17
  • 35

1 Answers1

0

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 { // ... }

Pankaj Kapare
  • 7,486
  • 5
  • 40
  • 56
  • Is there any other way that i can scan the input parameters is don't run in Asp.net compatibility mode. – user1844634 Feb 08 '16 at 18:36
  • If you don't like option of compatibility mode then you can explore IDispatchMessageInspector.AfterReceiveRequest. https://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.idispatchmessageinspector.afterreceiverequest(v=vs.110).aspx – Pankaj Kapare Feb 09 '16 at 00:02