WCF 配置架构WCF Configuration Schema

Windows Communication Foundation (WCF) 配置元素使您能够配置 WCF 服务和客户端应用程序。Windows Communication Foundation (WCF) configuration elements enable you to configure WCF service and client applications. 可以使用配置编辑器工具 (SvcConfigEditor.exe) 创建和修改客户端和服务的配置文件。You can use the Configuration Editor Tool (SvcConfigEditor.exe) to create and modify configuration files for clients and services. 由于配置文件的格式都是以 XML 形式设置的,因此,如果要使用文本编辑器手动编辑这些文件,则您必须熟悉 XML。Since the configuration files are formatted as XML, you must be familiar with XML if you want to manually edit them using a text editor. 否则,您可能会遇到一些问题,如找不到某个 XML 元素标记或特性。Otherwise, you may run into issues such as an unfound XML element tag or attribute. 这是因为 XML 元素标记和特性是区分大小写的。This is because XML element tags and attributes are case-sensitive.

WCF 配置系统基于System.Configuration命名空间。The WCF configuration system is based on the System.Configuration namespace. 因此,您可以使用 System.Configuration 命名空间提供的所有标准功能(如配置锁定、加密和合并)以提高应用程序及其配置的安全性。Therefore, you can use all the standard features provided by the System.Configuration namespace, such as configuration locking, encryption and merging to increase the security of your application and its configuration. 有关这些概念的更多信息,请参见下列主题。For more information on these concepts, see the following topics.

加密配置信息Encrypting Configuration Information

锁定配置设置Locking Configuration Settings

本节描述每个配置项的所有可能的值,以及它如何与其他 WCF 配置元素进行交互。This section describes all possible values of each configuration item, and how it interacts with other WCF configuration elements. 下图说明了 WCF 配置架构:The following map illustrates the WCF configuration schema:

显示 WCF 配置架构的关系图。


你应使用适当的访问控制列表 (ACL) 来保护应用程序配置文件 (app.config) 中的 WCF 配置节, 以防止任何潜在的安全威胁。You should protect WCF configuration sections in your application configuration files (app.config) with appropriate Access Control Lists (ACL) to prevent any potential security threats. 例如,你应确保仅有适当的人员可以访问或修改有关应用程序绑定的安全设置或服务的配置文件的服务模型节。For example, you should make sure that only the appropriate people can access or modify the security settings on application bindings, or the service model section of the configuration file for a service.

本节内容In This Section

描述 ServiceModel 元素。Describes the ServiceModel element.

配置 SMSvcHost.exe 工具。Configures the SMSvcHost.exe tool.

当使用序列化程序(如 DataContractSerializer)时,用于设置选项的顶级元素。The top-level element for setting options when using serializers such as the DataContractSerializer.

配置 Windows Communication Foundation 应用程序Configuring Windows Communication Foundation Applications
介绍如何配置 WCF 服务和客户端。Describes how to configure WCF services and clients.