开发者

difference between binding and binding extension in wcf

what is the difference between binding and bi开发者_如何转开发nding extension in WCF?


There's three different ways to use bindings in WCF. You can:

  1. Use the default bindings that come with WCF (e.g. wsHttpBinding, webHttpBinding, etc.);
  2. Customize a default binding so you can use it across different service endpoints (e.g. binding configuration); and,
  3. Use binding extensions to create your own custom binding that derives from the abstract Binding class which are usually composed of pre-defined BindingElements (such as your Transport and Message Encoding).

So, the difference between binding and binding extensions is the degree of customization. Using 'binding', as you said, is really using one of the pre-defined bindings that come with WCF. Probably for 60-70% of your situations, that will work for you. A binding extension requires you to create your own Binding class (deriving from the abstract Binding) and you are able to piece together the various BindingElements that come with WCF into your own customized binding. (Or, you can create your own BindingElement.)

So your question is really one of extremes on the WCF binding spectrum -- 'binding' is pre-defined, ready to use bindings that you associate to your endpoints and 'binding extension' is totally customized that requires you to code your binding before assigning it to an endpoint.

BTW, Aaron Skonnard has written a number of good articles for MSDN on WCF internals - I highly recommend that you check out his articles. Two that are very good are here and here.

I hope this helps.+

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜