Here’s a brief WCF overview I prepared recently for a development team.

What is Windows Communication Foundation (WCF)?

WCF is, in essence, a remote procedure call (RPC) framework for .NET.

Service Contracts and Operation Contracts

This is what your WCF service agrees to do for its callers.

Service contract

Data Contracts

These are the data types that your WCF service expects its callers to understand.

The service will also advertise a service-definition endpoint that will provide these data type definitions to its callers.

Data contract

Events (…or “Duplex Contracts”)

Out of scope for this article, but see How to: Create a Duplex Contract on MSDN for an explanation.

Hosting Your WCF Service

Hosting screenshot

Note the endpoint address:

Hosting screenshot

Adding a service reference to your project

The metadata exchange address is the equivalent of the old Web Service Definition Language (WSDL) address.

Adding a service reference

Calling the WCF Service

Call it just as you would your local methods.

Service method invocation

For curiosity’s sake, this is what some of the generated code looks like:

Generated code