This documentation is archived and is not being maintained.
ServiceDescriptionCollection.GetPortType Method
.NET Framework 1.1
Searches the ServiceDescriptionCollection and returns the PortType with the specified name that is a member of one of the ServiceDescription instances contained in the collection.
[Visual Basic] Public Function GetPortType( _ ByVal name As XmlQualifiedName _ ) As PortType [C#] public PortType GetPortType( XmlQualifiedName name ); [C++] public: PortType* GetPortType( XmlQualifiedName* name ); [JScript] public function GetPortType( name : XmlQualifiedName ) : PortType;
Parameters
- name
- The XmlQualifiedName, passed by reference, whose Name property is shared by the PortType returned.
Return Value
A PortType.
Exceptions
| Exception Type | Condition |
|---|---|
| Exception | The specified PortType is not a member of any ServiceDescription instances within the collection. |
Example
[Visual Basic] ' 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) [C#] // Construct an XML qualified name. XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("MathServiceSoap","http://tempuri2.org/"); // Get the PortType from the collection. PortType myPort = myCollection.GetPortType(myXmlQualifiedName); [C++] // Construct an XML qualified name. XmlQualifiedName* myXmlQualifiedName = new XmlQualifiedName(S"MathServiceSoap", S"http://tempuri2.org/"); // Get the PortType from the collection. myCollection->GetPortType(myXmlQualifiedName);
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
ServiceDescriptionCollection Class | ServiceDescriptionCollection Members | System.Web.Services.Description Namespace
Show: