I've been playing with Windows Communication Foundation for a while now, and one of the really strong points of WCF is it's extensibility story. While certainly not perfect, there are a lot of points where you can hook into the processing pipeline and introduce custom code into almost all aspects of the request processing  and metadata generation models.


There are some great resources on the extensiblity points that I've seen around:



I'm sure there are many more that I'm missing!


A few days ago, I posted about the WsdlNoticeBehavior I implemented as a custom IWsdlExportExtension, and now I've been playing with a different set of extensibility points. Here's a bit of sample code as to what it looks like:


[ServiceContract]


public interface IVoucherService


{


   [OperationContract]


   Voucher Buy(VoucherRequest request);


}


 


public class VoucherService : IVoucherService


{


   [InstrumentedOperation("VoucherService")]


   public Voucher Buy(VoucherRequest request)


   {


      // ...


   }


}



And here's the result of this:



There are a lot of pretty cool things you can do with the extensibility points in WCF, and I definitely expect to spend some more time going over them and experimenting with what you can do. Hopefully, we can get some cool reusable extensions out of this that other people can take advantage of (hey, that might even be a cool idea for an OSS project, if anyone else is interested).



Tomas Restrepo

Software developer located in Colombia. Sr. PFE at Microsoft.