PortCollection::Item Property (String^)
.NET Framework (current version)
Gets a Port specified by its name.
Assembly: System.Web.Services (in System.Web.Services.dll)
Parameters
- name
-
Type:
System::String^
The name of the Port returned.
Service^ myService; PortCollection^ myPortCollection; ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceItem_cs.wsdl" ); Console::WriteLine( "Total number of services : {0}", myServiceDescription->Services->Count ); for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) { myService = myServiceDescription->Services[ i ]; Console::WriteLine( "Name : {0}", myService->Name ); myPortCollection = myService->Ports; // Create an array of ports. Console::WriteLine( "\nPort collection :" ); for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) { Console::WriteLine( "Port[{0}] : {1}", i1, myPortCollection[ i1 ]->Name ); } String^ strPort = myPortCollection[ 0 ]->Name; Port^ myPort = myPortCollection[ strPort ]; Console::WriteLine( "\nIndex of Port[{0}] : {1}", strPort, myPortCollection->IndexOf( myPort ) );
.NET Framework
Available since 1.1
Available since 1.1
Show: