Wednesday, 11 April 2012

The ABC of Windows Communication Foundation


"ABC" is the WCF mantra. "ABC" is the key to understanding how a WCF service endpoint is composed.  Remember "ABC".
  • "A" stands for Address: Where is the service?
  • "B" stands for Binding: How do I talk to the service?
  • "C" stands for Contract: What can the service do for me?
"ABC" means that writing (and configuring) a WCF service is always a three-step process:
  • You define a contract and implement it on a service
  • You choose or define a service binding that selects a transport along with quality of service, security and other options
  • You deploy an endpoint for the contract by binding it (using the binding definition, hence the name) to a network address.

Also note that : 

1 )  These three elements (Service,Contract,Binding) are independent. 
2)  A contract can support many bindings and a binding can support many contracts. 
3)  A service can have many endpoints (contract bound to address) coexisting and available at the same time. 
4)  So if you want to expose your service via HTTP and use SOAP 1.1 for maximum interoperability, and also want to expose it via TCP using a binary wire encoding for maximum performance, the two resulting endpoints can reside side-by-side on top of the very same service.


Of course, not all bindings necessarily satisfy the needs of a given service contract or service implementation. If a service does, for instance, absolutely depend on certain security aspects, reliable messaging, transaction flow, or other features, it can demand that any binding that is used for exposing endpoints must support them. If a binding does not support the demanded features, the WCF runtime will detect the feature mismatch and will refuse to start the service.


Thanks for reading..!!


Default Programmer

No comments:

Post a Comment