ServiceEndpointCollection.Find 方法

定義

傳回從服務端點的集合所找到第一個符合特定準則的服務端點。

多載

Find(Type)

傳回從服務端點的集合所找到第一個符合指定的合約型別的服務端點。

Find(Uri)

從服務端點的集合傳回具有指定位址的服務端點。

Find(XmlQualifiedName)

從服務端點的集合傳回具有指定的命名空間和合約名稱的服務端點。

Find(Type, XmlQualifiedName)

從服務端點的集合傳回具有指定繫結名稱和命名空間之指定合約型別的服務端點。

Find(XmlQualifiedName, XmlQualifiedName)

從服務端點的集合傳回具有指定的合約名稱和命名空間以及繫結名稱和命名空間的第一個服務端點。

備註

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

Find(Type)

傳回從服務端點的集合所找到第一個符合指定的合約型別的服務端點。

public:
 System::ServiceModel::Description::ServiceEndpoint ^ Find(Type ^ contractType);
public System.ServiceModel.Description.ServiceEndpoint Find (Type contractType);
member this.Find : Type -> System.ServiceModel.Description.ServiceEndpoint
Public Function Find (contractType As Type) As ServiceEndpoint

參數

contractType
Type

服務端點之合約的 Type

傳回

ServiceEndpoint

指定之合約型別的第一個 ServiceEndpoint,如果找不到則為 null

例外狀況

contractTypenull

備註

Find(Type) 多載專屬於 Windows Communication Foundation (WCF) 程式設計模型。 它會查看每個端點的 ContractType 屬性。 ContractType如果 ContractDescription 不是從 WCF 程式設計模型建立 ,則可能 null 是 , (類型具有 *Contract 屬性) 。

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

適用於

Find(Uri)

從服務端點的集合傳回具有指定位址的服務端點。

public:
 System::ServiceModel::Description::ServiceEndpoint ^ Find(Uri ^ address);
public System.ServiceModel.Description.ServiceEndpoint Find (Uri address);
member this.Find : Uri -> System.ServiceModel.Description.ServiceEndpoint
Public Function Find (address As Uri) As ServiceEndpoint

參數

address
Uri

服務端點的 Uri

傳回

ServiceEndpoint

指定之位址的第一個 ServiceEndpoint,如果找不到則為 null

例外狀況

addressnull

備註

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

適用於

Find(XmlQualifiedName)

從服務端點的集合傳回具有指定的命名空間和合約名稱的服務端點。

public:
 System::ServiceModel::Description::ServiceEndpoint ^ Find(System::Xml::XmlQualifiedName ^ contractName);
public System.ServiceModel.Description.ServiceEndpoint Find (System.Xml.XmlQualifiedName contractName);
member this.Find : System.Xml.XmlQualifiedName -> System.ServiceModel.Description.ServiceEndpoint
Public Function Find (contractName As XmlQualifiedName) As ServiceEndpoint

參數

contractName
XmlQualifiedName

服務的合約的 XmlQualifiedName

傳回

ServiceEndpoint

具有指定的命名空間和合約名稱的第一個 ServiceEndpoint,如果找不到則為 null

備註

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

適用於

Find(Type, XmlQualifiedName)

從服務端點的集合傳回具有指定繫結名稱和命名空間之指定合約型別的服務端點。

public:
 System::ServiceModel::Description::ServiceEndpoint ^ Find(Type ^ contractType, System::Xml::XmlQualifiedName ^ bindingName);
public System.ServiceModel.Description.ServiceEndpoint Find (Type contractType, System.Xml.XmlQualifiedName bindingName);
member this.Find : Type * System.Xml.XmlQualifiedName -> System.ServiceModel.Description.ServiceEndpoint
Public Function Find (contractType As Type, bindingName As XmlQualifiedName) As ServiceEndpoint

參數

contractType
Type

服務端點之合約的 Type

bindingName
XmlQualifiedName

服務的繫結的 XmlQualifiedName

傳回

ServiceEndpoint

指定的合約型別、繫結名稱和命名空間的第一個 ServiceEndpoint,如果找不到則為 null

例外狀況

contractTypebindingNamenull

備註

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

適用於

Find(XmlQualifiedName, XmlQualifiedName)

從服務端點的集合傳回具有指定的合約名稱和命名空間以及繫結名稱和命名空間的第一個服務端點。

public:
 System::ServiceModel::Description::ServiceEndpoint ^ Find(System::Xml::XmlQualifiedName ^ contractName, System::Xml::XmlQualifiedName ^ bindingName);
public System.ServiceModel.Description.ServiceEndpoint Find (System.Xml.XmlQualifiedName contractName, System.Xml.XmlQualifiedName bindingName);
member this.Find : System.Xml.XmlQualifiedName * System.Xml.XmlQualifiedName -> System.ServiceModel.Description.ServiceEndpoint
Public Function Find (contractName As XmlQualifiedName, bindingName As XmlQualifiedName) As ServiceEndpoint

參數

contractName
XmlQualifiedName

服務的合約的 XmlQualifiedName

bindingName
XmlQualifiedName

服務的繫結的 XmlQualifiedName

傳回

ServiceEndpoint

具有指定的繫結名稱、合約名稱和命名空間的第一個 ServiceEndpoint

例外狀況

contractNamebindingNamenull

備註

可能會有多個端點符合此準則。 此方法會傳回集合中遇到的第一個符合項目。 如果您需要尋找符合指定之準則的所有 ServiceEndpoint 物件,請改用其中一個 FindAll 方法。

適用於