开发者

WCF: How do i implement a protocol channel to apply with a custom channel

开发者 https://www.devze.com 2022-12-25 03:33 出处:网络
Consider the following picture representing the WCF channel stack: alt text http://i.msdn.microsoft.com/ee672186.image001(en-us).jpg

Consider the following picture representing the WCF channel stack:

alt text http://i.msdn.microsoft.com/ee672186.image001(en-us).jpg

I'm implementing my own channel and for that i already implemented the transport and encoding layer. Now i need to create a "protocol channel" layer where the messages should pass after created in encode layer and before get in th开发者_开发问答e service layer.

I guess i need to create a BindingElement whose implements some interface and then add these bindingElement to my Binding. But all documentation i can find just explains how to implement the transport and encoding layers...

Any help? Thanks


As far as I remember, it's pretty much the same thing, meaning you implement a BindingElement as you mentioned, and override the BuildChannelFactory/BuildChannelListener methods to return the factory/listeners for your custom protocol channel.

The difference is that you'll use BindingContext.BuildInnerChannelFactory() and BuildInnerChannelListener() methods to layer your custom channel factory/listener on top of the ones in lower levers of the stack (like your transport channel).

Does that make sense?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号