PortTypeCollection.Item Property (String)

 

Gets the PortType specified by its name.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

Public ReadOnly Property Item (
	name As String
) As PortType

Parameters

name
Type: System.String

The name of the PortType returned.

Property Value

Type: System.Web.Services.Description.PortType

The name of the value parameter.

Exception Condition
InvalidCastException

The value parameter cannot be explicitly cast to type PortType.

Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("MathService_VB.wsdl")

Dim myPortTypeCollection As PortTypeCollection = _
   myServiceDescription.PortTypes
Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count
Console.WriteLine(ControlChars.Newline & _
   "Total number of PortTypes: " & noOfPortTypes.ToString())

Dim myNewPortType As PortType = myPortTypeCollection("MathServiceSoap")

.NET Framework
Available since 1.1
Return to top
Show: