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)

适用于