WCF Windsor Interceptor, AOP with Logging and Exception Handler Interceptor

WcfServiceExample.zip (7.57 mb)

 

The above example uses Windows Communication Foundation (WCF) Integration Facility

The main idea here is that WCF should get the service instances from Windsor, which gives us all the usual advantages of IoC plus Windsor’s interceptors capabilities. It isn’t a lot of code, but it makes it much easier to work with WCF services.

The service contains 2 simple methods on the HelloWorld class.

—  SayHello — returns a string “Hello World”
—  ThrowException — throws an exception

Every single call to each of these is intercepted and logged.  Whilst the throw exception will always be caught by the exceptionhandler interceptor.

The first project in the solution is the WCF service, whilst the second is just a WPF client tester.
The project outlook is as follows: