教學課程:開始使用 Windows Communication Foundation 應用程式Tutorial: Get started with Windows Communication Foundation applications

下面一系列教學課程會為您介紹至 Windows Communication Foundation (WCF) 程式設計經驗。The following series of tutorials introduce you to the Windows Communication Foundation (WCF) programming experience. 透過這些教學課程中順序的工作會提供您建立 WCF 應用程式所需的步驟大致了解。Working through these tutorials in order will give you an introductory understanding of the steps required to create WCF applications. 完成之後,您必須執行的 WCF 服務和 WCF 用戶端呼叫服務。After you finish, you'll have a running WCF service and a WCF client that calls the service.

此教學課程假設您使用 Visual Studio 作為開發環境。The tutorial assumes you're using Visual Studio as the development environment. 如果您使用另一個開發環境,請略過 Visual Studio 特定指示。If you're using another development environment, ignore the Visual Studio-specific instructions.

您可以下載並執行範例 WCF 應用程式,請參閱 < Windows Communication Foundation 範例For sample WCF applications that you can download and run, see Windows Communication Foundation samples. 如需簡介範例,請參閱 < 開始使用範例For an introduction to the samples, see Getting started sample.

如需建立服務和用戶端的詳細深入資訊,請參閱 < 基本 WCF 程式設計For more in-depth information about creating services and clients, see Basic WCF programming.

WCF 的教學課程WCF tutorials

前三個教學課程說明如何定義 WCF 服務合約、 如何實作它,以及如何裝載它。The first three tutorials describe how to define a WCF service contract, how to implement it, and how to host it. 您所建立的服務是自我裝載的主控台應用程式中。The service that you create is self-hosted within a console application. 您也可以裝載在 Microsoft Internet Information Services (IIS 服務)。You can also host services under Microsoft Internet Information Services (IIS). 如需詳細資訊,請參閱如何:將 WCF 服務裝載於 IISFor more information, see How to: Host a WCF Service in IIS. 雖然您可以使用程式碼來設定服務在本教學課程中,您也可以設定服務組態檔內Although you use code to configure the service in the tutorial, you can also configure services within a configuration file.

下面兩個教學課程說明如何建立、 設定和使用用戶端應用程式,來呼叫服務作業公開 (expose)。The next two tutorials describe how to create, configure, and use a client application to call the operations the service exposes. 服務會發行定義用戶端應用程式與服務進行通訊所需之資訊的中繼資料。Services publish metadata that define the information a client application needs to communicate with the service. Visual Studio 會存取此中繼資料的程序自動化,並使用它來建構服務的用戶端應用程式。Visual Studio automates the process of accessing this metadata and uses it to construct the client application for the service. 如果您決定不使用 Visual Studio,您可以使用ServiceModel Metadata Utility 工具 (Svcutil.exe)改。If you decide not to use Visual Studio, you can use the ServiceModel Metadata Utility tool (Svcutil.exe) instead.

  • 教學課程:建立用戶端Tutorial: Create a client

    擷取從 WCF 服務建立 WCF 用戶端 proxy 的中繼資料。Retrieve metadata for creating a WCF client proxy from a WCF service. 您使用 Visual Studio 加入服務參考來擷取中繼資料,或者您可以使用 ServiceModel Metadata Utility 工具。You retrieve metadata by using Visual Studio to add a service reference or you can use the ServiceModel Metadata Utility tool. 您指定用戶端用來存取服務的端點。You specify the endpoint that the client uses to access the service.

  • 教學課程:使用用戶端Tutorial: Use a client

    您可以使用 WCF 用戶端 proxy 來呼叫服務作業。Use the WCF client proxy to call the service operations.

參考資料Reference

另請參閱See also