I have written a custom MessageEncoder for a WCF pipeline, which is then applied using a BindingElementExtensionElement within my app.config.
On the server, when a message arrives, my message encoder needs to pull some information from the stream, and hold it for the duration of the Operation Context, so that it may be returned as a header in the response. The header manipulation screams of Behavior functionality, so... I would like to know, how do I get my custom encoder to also apply a custom Behavior to the pipeline (which is where I will take care of storing this special 'information' across an operation context) - the encoder is essentially useless without the behavior, so I dont want to rely on the user remembering to add the behavior config when they add the encoder config - it should just happen automatically under the covers.
Additionally, where is a good resource for reading about the lifecycle of these pipeline elements?
Thanks