what is the difference between binding and binding extension in WCF?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s three different ways to use bindings in WCF. You can:
with WCF (e.g. wsHttpBinding,
webHttpBinding, etc.);
default binding so you can use it
across different service endpoints
(e.g. binding configuration); and,
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.+