|
<Update> I forgot an extension hook: IDispatchOperationSelector Defines the contract that associates incoming messages with a local operation to customize service execution behavior. </Update>
WCF is extensible, very extensible. If you need a feature which is not in V1 (and obviously there is quite a lot of 'missing', as it is a V1), go and write your custom code and hook it in. Or if you need a feature which is not really the responsibility of WCF as a platform but rather is part of your business, go and write the code, chose the appropriate interface and hook it in. My friend Ralph posted a complete code listing with all available major WCF extensibility points at the Service Model layer. Helping him out I moved it to the Feb CTP and also created a VS 2005 solution for your convenience to test this stuff. There are a number of extension hooks: // Custom client extension. // Processes messages flowing through a proxy. IClientMessageInspector // Custom client or service extension. // Processes messages and objects scoped to a single operation. IParameterInspector // Custom service-side extension. // Controls channel creation. IChannelInitializer // Custom service-side extension. // Processes messages flowing through a service. IDispatchMessageInspector // Custom service-side extension. // Participates in closing input sessions. IInputSessionShutdown // Custom service-side extension. // Participates in InstanceContext initialization. IInstanceContextInitializer // Custom service-side extension. // Helps control the lifetime of shared sessions. IShareableInstanceContextLifetime // Custom service-side extension. // Participates in providing service objects to the InstanceContext. IInstanceProvider // Custom service-side extension. // Controls the processing of errors on the service side. IErrorHandler // Custom service-side extension. // Represents an interceptor for the incoming message where we can choose which method actually to call. IOperationInvoker In addition, there are also some insertion hooks where we can apply the extensions: // Inserts custom service-side extensions. // Adds customization components for all // messages flowing through a service endpoint. // Inserts custom client-side extensions. // Adds customization components for all // messages flowing through a proxy. IEndpointBehavior // Inserts custom service-side extensions. // Adds extensions during the construction of the run time. IServiceBehavior // Inserts custom extensions on client or service. // Adds customization components for a particular contract. IContractBehavior // Inserts custom extensions on either client or service. // Adds customization components for a specific operation. IOperationBehavior Obviously it does not make sense to post the code here verbatim - just check out the download and lemme know if you have questions. Well, there is currently only the 'imperative' model implemented in my code which means I add the extensions to WCF in code - but in a lot of scenarios it would be nice to add them via config.
And of course now I expect Ralph to ping back with an updated version of my code showing how to wire up all the extensions in config - go!
|