新聞中心
WCF框架為終結點定義了一個專門的ServiceEndpoint類,被定義在System.ServiceModel.Description命名空間中。ServiceEndpoint類包含了EndpointAddress,Binding,ContractDescription三個類型的屬性,分別對應Endpoint的Address,Binding,Contract,如下圖:

創(chuàng)新互聯(lián)云計算的互聯(lián)網(wǎng)服務提供商,擁有超過13年的服務器租用、四川電信機房托管、云服務器、雅安服務器托管、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗,已先后獲得國家工業(yè)和信息化部頒發(fā)的互聯(lián)網(wǎng)數(shù)據(jù)中心業(yè)務許可證。專業(yè)提供云主機、雅安服務器托管、域名注冊、VPS主機、云服務器、香港云服務器、免備案服務器等。
要獲取服務的終結點,可以通過抽象類MetadataImporter獲取,類的定義如下:
- public abstract class MetadataImporter
- {
- public abstract Collection
ImportAllContracts(); - public abstract ServiceEndpointCollection ImportAllEndpoints();
- 其它方法略;
- }
在WCF框架中,最重要的一個方法是ImportAllEndpoints(),WCF框架能夠獲取服務的所有終結點,并返回一個ServiceEndpointCollection類型的對象。該WCF框架為一個終結點集合,可以通過調(diào)用ServiceEndpointCollection的Find()方法或FindAll()方法,找到符合條件的一個或多個終結點。它的定義如下:
- public class ServiceEndpointCollection : Collection
- {
- public ServiceEndpoint Find(Type contractType);
- public ServiceEndpoint Find(Uri address);
- public Collection
FindAll(Type contractType); - 其它成員略
- }
當前文章:對于WCF框架解釋說明
網(wǎng)頁網(wǎng)址:http://m.fisionsoft.com.cn/article/coiepch.html


咨詢
建站咨詢
