共用方式為


ServiceDescriptionCollection.GetPortType(XmlQualifiedName) 方法

定義

搜尋 ServiceDescriptionCollection 並傳回具有指定名稱的 PortType,其為包含在集合中的其中一個 ServiceDescription 執行個體的成員。

public:
 System::Web::Services::Description::PortType ^ GetPortType(System::Xml::XmlQualifiedName ^ name);
public System.Web.Services.Description.PortType GetPortType (System.Xml.XmlQualifiedName name);
member this.GetPortType : System.Xml.XmlQualifiedName -> System.Web.Services.Description.PortType
Public Function GetPortType (name As XmlQualifiedName) As PortType

參數

name
XmlQualifiedName

XmlQualifiedName,以傳址方式傳遞它,其 Name 屬性由傳回的 PortType 共用。

傳回

PortType

具有指定名稱的 PortType

例外狀況

指定的 PortType 不是集合內任何 ServiceDescription 執行個體的成員。

範例

// Construct an XML qualified name.
XmlQualifiedName^ myXmlQualifiedName =
   gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" );

// Get the PortType from the collection.
myCollection->GetPortType( myXmlQualifiedName );
// Construct an XML qualified name.
XmlQualifiedName myXmlQualifiedName =
   new XmlQualifiedName("MathServiceSoap","http://tempuri2.org/");
// Get the PortType from the collection.
PortType myPort = myCollection.GetPortType(myXmlQualifiedName);
' Construct an XML qualified name.
Dim myXmlQualifiedName As _
   New XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/")
' Get the PortType from the collection.
Dim myPort As PortType = myCollection.GetPortType(myXmlQualifiedName)

適用於