语言

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共享。

返回

具有指定名称的 < a0/> 。

例外

指定的 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)

适用于