<client>

client 元素定义客户端可以连接到的终结点列表。

<configuration>
  <system.serviceModel>
    <client>

Syntax

<system.serviceModel>
  <client>
    <endpoint>
    </endpoint>
    <metadata>
    </metadata>
  </client>
</system.serviceModel>

特性和元素

下列各节描述了特性、子元素和父元素。

特性

None

子元素

元素 Description
<端点> 包含一组终结点元素,这些元素指定此客户端可以连接到的终结点。
<元> 包含用于处理元数据的设置。

父元素

元素 Description
<system.serviceModel> 所有 Windows Communication Foundation (WCF) 配置元素的根元素。

注解

client 部分定义客户端可连接到的终结点列表。 客户端节中列出的每个终结点定义其自己的绑定、行为和协定。 它由属性和属性的组合namecontract唯一标识。 客户端代码指定要 name 连接到客户端实现的服务的终结点。 如果省略该 name 属性,则终结点充当它实现的协定的默认终结点。

此外,本节还指定用于处理元数据的设置。

Example

<client>
  <endpoint address="/HelloWorld/"
            bindingConfiguration="usingDefaults"
            name="MyBinding"
            binding="customBinding"
            contract="HelloWorld">
    <addressProperties actingAs="http://www.microsoft.com/TestActor"
                       identityData="BasicReadWrite"
                       identityType="Spn"
                       isAddressPrivate="false" />
  </endpoint>
</client>

另请参阅