共用方式為


<client>

client 項目會定義用戶端可連線的端點清單。

<<system.serviceModel>>
  <client>

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

屬性和項目

屬性

子項目

項目 描述

<client> 的 <endpoint>

包含端點項目的清單,其中的端點項目指定這個用戶端可連線的端點。

<metadata>

包含處理中繼資料的設定。

父項目

項目 描述

<<system.serviceModel>>

所有 Windows Communication Foundation (WCF) 組態項目的根項目。

備註

client 區段會定義用戶端可連線的端點清單。在用戶端區段中定義的每個端點會定義它自己的繫結、行為和合約。它是以 namecontract 屬性的組合唯一識別的。用戶端程式碼指定 name 以連線至用戶端所實作服務的端點。如果省略 name 屬性,則端點會做為它所實作合約的預設端點。

此外,本區段也會指定處理中繼資料的設定。

範例

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

請參閱

參考

ClientSection
MetadataElement

其他資源

WCF Client Configuration
Clients