Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the WCF equivalent of an HTTPModule?

Tags:

.net

wcf

Is there some uniform way I can implement behavior that occurs around a set of WCF service calls? I'm looking for a simple way to handle cross-cutting behavior like logging, initialization, error handling, authorization etc. With ASP.NET a lot of this is easy to implement as an HTTPModule.

Any helpful suggestions?

like image 696
Eric Nicholson Avatar asked Sep 25 '09 17:09

Eric Nicholson


People also ask

What WCF in ASP net?

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.


1 Answers

There are a whole bunch of extensibility points in WCF you can use for stuff like this. They include:

  • IDispatchMessageInspector
  • IErrorHandler
  • IParameterInspector
  • Behaviors (IServiceBehavior, IEndpointBehavior, IOperationBehavior)

Additionally, you can create custom ServiceHost classes to use either directly or through ServiceHostFactory, and then there's the entire channel stack model which is pretty extensible (if a bit complex at times).

like image 170
tomasr Avatar answered Oct 22 '22 14:10

tomasr