views:

186

answers:

0

I'm trying to gain a better understanding of WCF's dispatch process in particular the impact and effect on the various extensibility points. From the web pages listed at the bottom, it appears that WCF will do the following in the stated sequence once a message is passed to the dispatcher by the channel stack.

  1. Message Inspector
  2. Operation Selector
  3. Message Formatting
  4. Parameter Inspector
  5. Operation Invoker.

I'm trying to find some options to resolve an issue I have and one way I'm thinking of is to use a combination of Message Inspector, Operation Selector, Message Formatting and Operation Invoker. Unfortunately, my observation seems to indicate the sequence of execution is as follows instead:

  1. Operation Selector
  2. Message Inspector
  3. Operation Invoker (AllocateInputs())
  4. Message Formatting
  5. Parameter Inspector
  6. Operation Invoker (Invoke())

I can understand the slight difference where a custom invoker AllocateInputs() method is called before formatting the message as the Message Formatting section is essentially deserialising the given message into a set of method arguments to be passed on to the appropriate operation and the invoker's AllocateInputs() method specifies how many parameters are expected.

The part that throws me is the inversion of sequence between Message Inspector and Operation Selector. It sounds logical to me for Message Inspectors to be run through first as they act on the message whereas Operation Selector determines which service operation the message is targeted for.

Questions:

  • Is that due to different versions or releases of WCF?
  • Is this because WCF does not actually specify extensibility points execution sequence?

Reference pages:
Extending WCF to support custom data formats - Zulfiqar's weblog
Extending WCF with Custom Behaviours - MSDN Service Station December 2007
Message Flow Interception Points - Nicholas Allen's Indigo Blog

Note: My apologies for not providing links, can't have more than one since I'm still a noob. =)