WCF Part 1 Services ABC
I want to begin with a conceptual explanation about services. A service always has at least one endpoint, but can have multiple. A client normally communicates with only one endpoint. A plain-old-webservice only has one endpoint and communicates via HTTP and Text/XML. The picture below shows a service with three endpoints. Notice the ABC.
There are a few articles about the WCF ABC’s (1, 2)but the short story is that you always have to remember:
- A stands for Address
- B stands for Binding
- C stands for Contract
I’ll try to explain them, they’ll get more sense once we advanced in posts.
- Address Every website and webservice has an address, like https://bloggingabout-linux.azurewebsites.net/ or http://mydomain.com/stockquote.asmx. Our WCF services also must have an address. WCF can provided addresses for the following protocols:
- HTTP
- TCP
- NamedPipe
- Peer2Peer
- MSMQ
- Binding A binding specifies how a service is accessible. Think transport protocol (see the previous list that shows the basic list), encoding (text, binary, etc) and WS-* protocols like transactional support or reliable messaging.
- Contract The contract is something you completely specify by yourself. The contract is used to specify what your service can do. For example give you the correct streetname and city when providing a zipcode.
In the next articles I’ll explain how you can build a service while using the ABC.