The Baker’s Dozen: A 13-Step Crash Course for Learning Windows Communication Foundation (WCF) This article will present a crash-course in the basics of Windows Communication Foundation (WCF). WCF is one of the exciting new capabilities in the .NET 3.0 Framework. It provides a unified and uniform programming model for building distributed applications. Those who previously built multiple code bases to deal with Web services and .NET remoting will surely come to appreciate the power standardization that WCF offers. WCF, like any other new technology, requires research and experimentation to become productive. This article will assume no prior experience with WCF, and will walk you through some basic exercises and steps to show WCF’s capabilities. What’s on the Baker’s Dozen Menu this Time? In this article I will present a step-by-step guide to building distributed applications with WCF. I’ll minimize the amount of “reading between the lines” that sometimes happens with reference material that makes assumptions about the reader’s knowledge. If you’ve already built even a simple WCF application, you probably won’t find this article to be much more than a refresher-I’m focusing on what someone new to WCF will need for a “crash course”. I’ll walk you through these thirteen steps: - Identify all of the required downloads for developing WCF applications.
- Identify the requirements for a demo distributed application that this article will build using WCF.
- Present an overview of WCF architecture, and how you can use WCF to handle all of the requirements of the demo application.
- Build your first demo-a self-hosted WCF service in which you build the necessary .NET interfaces for the different layers to communicate (part 1 of 3).
- Build the demo .NET server and establish a configuration file to host a WCF service (part 2 of 3).
- Build a .NET client piece to access the WCF service (part 3 of 3).
- Modify the first demo to use more of the WCF object model with code, instead of configuration files.
- The Baker’s Dozen Spotlight: Build a second demo that builds and hosts a WCF service using IIS, in the same way you’d build and host ASMX files (part 1 of 2).
- Host a WCF service using IIS: build the client (part 2 of 2).
- Create a WCF XML Web service and establish configurations for non-.NET clients to consume it (part 1 of 3).
- Register a WCF XML Web service with IIS (part 2 of 3).
- Write code in a non-.NET client to consume the WCF service (part 3 of 3).
- Address some security options with WCF.
See the Recommended Reading section at the end of this article where I list several links to articles that you’ll hopefully feel more comfortable reading after this article. “There Are No Bad Questions…” If you’re new to WCF and distributed computing you may wonder how WCF fits in. | " | Some .NET developers think that you can only use WCF in a Vista environment. In fact, you also can use it with Windows XP Professional. I built and ran all of the sample code using Windows XP Professional.
| " |
Distributed computing is an architecture where the various components of an application reside on different computer systems (often called domains). For example, suppose you load SQL Query Analyzer (or SQL Management Studio) from your desktop, and you open a database on your company’s database server. You type a query or run a stored procedure and you get the results. This is a very basic example of distributed computing. You typed the query from your desktop, but the server performed the work on the server, and fed the results back to you. So each component of the application performed a portion of the overall task. Now think about this from an enterprise standpoint-you want the work and processing to execute on the servers (or domains) that make the most sense. A typical distributed application might feature a client module, a Web server, an application server, and a database server. You may want certain processes to execute on certain domains-perhaps to take advantage of specific hardware, to follow certain development guidelines, or because of restrictions or policies, or maybe other reasons. This article won’t cover how to architect a distributed application. I make the assumption that you’ve already decided where you want processing to occur. Developers often use XML Web services or .NET remoting protocols (or both) so that components of distributed applications can communicate and interact. Prior to WCF, developers usually needed to write and maintain different code bases to deal with each protocol. WCF allows developers to work with these protocols using a unified programming model-eliminating the need for separate code bases. This article will walk through the steps of creating simple WCF applications that use both Web services and remoting. By the end of the article, you’ll see how you can use the WCF programming model to write a single code base to deal with all of the protocol differences. I’m Not Using Windows Vista (Yet) Some .NET developers think that you can only use WCF in a Vista environment. In fact, you also can use it with Windows XP Professional. I built and ran all of the sample code using Windows XP Professional. | & | | 
By: Kevin S Goff
Kevin S. Goff, a Microsoft MVP award recipient for 2007, is the founder and principal consultant of Common Ground Solutions, a consulting group that provides custom Web and desktop software solutions in .NET, VFP, SQL Server, and Crystal Reports. Kevin is the author of Pro VS 2005 Reporting using SQL Server and Crystal Reports, published by Apress. Kevin has been building software applications since 1988. He has received several awards from the U.S. Department of Agriculture for systems automation. He has also received special citations from Fortune 500 Companies for solutions that yielded six-figure returns on investment. He has worked in such industries as insurance, accounting, public health, real estate, publishing, advertising, manufacturing, finance, consumer packaged goods, and trade promotion. In addition, Kevin provides many forms of custom training. Contact Kevin at kgoff@commongroundsolutions.net
kgoff@commongroundsolutions.net | Fast Facts | | Windows Communication Foundation (WCF) is one of the primary components of the .NET 3.0 Framework. WCF provides a uniform and unified programming model for distributed applications, and eliminates the need for multiple code bases to deal with the differences between communication protocols. | |
|