Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.
Getting started sample
The service describes the operations it performs in a service contract that it exposes publicly as metadata.
The service implementation calculates and returns the appropriate result, as shown in the following example code.
The service exposes an endpoint for communicating with the service, defined using a configuration file (Web.config), as shown in the following sample configuration.
The client communicates using a given contract type by using a client class that is generated by the ServiceModel Metadata Utility Tool (Svcutil.exe).
Run the following command from the SDK command prompt in the client directory to generate the typed proxy:
Like the service, the client uses a configuration file (App.config) to specify the endpoint with which it wants to communicate. The client endpoint configuration consists of an absolute address for the service endpoint, the binding, and the contract, as shown in the following example.
The client implementation instantiates the client and uses the typed interface to begin communicating with the service, as shown in the following example code.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0