Integrating with Windows Communication Foundation (WCF)
Applies to: SharePoint Foundation 2010
The Windows Communication Foundation (WCF) service model controls communication between client and service. The Service Application Framework model controls deployment, management, and discovery of services in a server farm. These models are complementary, and the SharePoint 2010 model is ideal for deploying, managing, and discovering WCF service clients and endpoints.
For more information about WCF, see Windows Communication Foundation.
Components of a WCF Service
A WCF service has three components:
A service class that implements the service to be provided
A host environment to host the service
One or more endpoints to which clients can connect
Communicating with a WCF Service
Each endpoint has four properties that determine the following:
An address for the endpoint
A binding that specifies how a client can communicate with the endpoint
A contract that identifies the available operations
A set of behaviors that specify local implementation details of the endpoint
For more information about using WCF endpoints with the Service Application Framework, see Using Service Endpoints.
Creating a WCF Service
To create a WCF service, you perform the following basic tasks, in order:
Define the service contract. A service contract specifies the signature of a service, the data it exchanges, and other contractually required data.
Implement the contract. Create the class that implements the contract and specify custom behaviors that the runtime should have.
Configure the service by specifying endpoint information and other behavior information.
Host the service in an application.
Build a client application.
For a detailed example, see Creating a Custom WCF Service in SharePoint Foundation.