延伸 WCFExtending WCF

Windows Communication Foundation (WCF)可讓您修改和擴充執行時間元件,以精確地控制和擴充以服務為基礎的應用程式。Windows Communication Foundation (WCF) allows you to modify and extend run time components to precisely control and extend service-based applications. 本節中的主題將深入說明延伸性結構。The topics in this section go in depth about the extensibility architecture. 如需基本程式設計的詳細資訊,請參閱基本 WCF 程式設計For more information about basic programming, see Basic WCF Programming.

本節內容In This Section

擴充 ServiceHost 與服務模型層Extending ServiceHost and the Service Model Layer
服務模型層負責從基礎通道提取傳入訊息,將它們以應用程式碼轉譯成方法叫用,然後將結果傳回給呼叫者。The service model layer is responsible for pulling incoming messages out of the underlying channels, translating them into method invocations in application code, and sending the results back to the caller. 服務模型延伸會修改或實作涉及發送器功能、自訂行為、訊息與參數攔截與其他延伸性功能的執行或通訊行為與功能。Service model extensions modify or implement execution or communication behavior and features involving dispatcher functionality, custom behaviors, message and parameter interception, and other extensibility functionality.

擴充繫結Extending Bindings
繫結是描述連接至端點所需之通訊詳細資料的物件。Bindings are objects that describe the communication details required to connect to an endpoint. 繫結延伸或自訂繫結會實作支援應用程式功能所需的自訂通訊功能。Binding extensions or custom bindings implement custom communication functionality required to support application features.

擴充通道層Extending the Channel Layer
通道層位於服務模型層之下,負責用戶端和服務之間的訊息交換。The channel layer sits beneath the service model layer and is responsible for the exchange of messages between clients and services. 通道延伸可以實作新的通訊協定功能,例如安全性。Channel extensions can implement new protocol functionality, such as security. 通道延伸也會傳輸功能,例如實作新的網路傳輸以傳送 SOAP 訊息。Channel extensions also transport functionality, such as implementing a new network transport to carry SOAP messages.

擴充安全性Extending Security
WCF 中的安全性是由傳輸安全性(完整性、機密性和驗證)、存取控制(授權)和審核所組成。Security in WCF consists of transfer security (integrity, confidentiality, and authentication), access control (authorization) and auditing. IdentityModel命名空間中找到的類別是由 WCF 用於存取控制。The classes found in the IdentityModel namespace are used by WCF for access control. 瞭解安全性結構可讓您建立自訂宣告類型,以配合自訂存取控制系統。Understanding the security architecture allows you to create custom claim types to accommodate custom access control systems.

擴充中繼資料系統Extending the Metadata System
WCF 中繼資料系統是一組類別和介面,代表執行以服務為基礎的應用程式所需的中繼資料。The WCF metadata system is a group of classes and interfaces that represent metadata required to implement service-based applications. 修改或擴充類別,或是實作和設定介面,即可匯出和匯入自訂中繼資料 (例如 Web 服務描述語言 (WSDL) 擴充功能或自訂 WS-PolicyAttachments 判斷提示)。Modify or extend the classes or implement and configure the interfaces to export and import custom metadata such as Web Services Description Language (WSDL) extensions or custom WS-PolicyAttachments assertions.

擴充編碼器與序列化程式Extending Encoders and Serializers
編碼器和序列化程式會將資料從一種形式轉譯為另一種形式。Encoders and serializers translate data from one form to another. 本節中的主題將說明如何延伸所提供的類別,以符合特殊需求。The topics in this section discuss how to extend the supplied classes to meet special requirements.

參考資料Reference

System.ServiceModel

System.ServiceModel.Channels

System.ServiceModel.Description

System.IdentityModel.Claims

System.IdentityModel.Policy

System.IdentityModel.Selectors

System.IdentityModel.Tokens

基本 WCF 程式設計Basic WCF Programming

WCF 功能詳細資料WCF Feature Details

方針及最佳做法Guidelines and Best Practices