Sunday, May 15, 2011

WCF Service Endpoint Basics

Service Endpoint Basics

All communication with a Windows Communication Foundation (WCF) service happens through the endpoints of the service. Endpoints allow clients to access the functionality offered by a WCF service. Every endpoint must be associated with an address, a binding, and a contract

Eg:
<endpoint address="" binding="wsHttpBinding" contract="IService">

ABCs of Endpoints


Address: The address for an endpoint is a unique Uniform Resource Locator (URL) that identifies the location of the service. The address should follow the Web Service Addressing (WS-Addressing) standard.
 
Binding: The binding determines how the service can be accessed. This means that the binding can specify not only the protocol used to access the service but an encoding method used to format the message contents.
 
Contract: The final element in the service endpoint is the contract. This identifies the operations exposed by the service, and it typically refers to the interface name, preceded by the project namespace. By including the namespace, you are using the fully qualified type name for the contract.