語言

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 不屬於集合中的任何 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)

適用於