PortCollection.Item Property (Int32)
.NET Framework 2.0
Gets or sets the value of a Port at the specified zero-based index.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public: property Port^ default [int] { Port^ get (int index); void set (int index, Port^ value); }
/** @property */ public Port get_Item (int index) /** @property */ public void set_Item (int index, Port value)
Not applicable.
Parameters
- index
The zero-based index of the Port whose value is modified or returned.
Property Value
A Port.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 ); }
Service myService;
PortCollection myPortCollection;
ServiceDescription myServiceDescription =
ServiceDescription.Read("MathServiceItem_jsl.wsdl");
Console.WriteLine("Total number of services : "
+ myServiceDescription.get_Services().get_Count());
for (int i = 0; i < myServiceDescription.get_Services().
get_Count(); ++i) {
myService = myServiceDescription.get_Services().get_Item(i);
Console.WriteLine("Name : " + myService.get_Name());
myPortCollection = myService.get_Ports();
// Create an array of ports.
Console.WriteLine("\nPort collection :");
for (int i1 = 0; i1 < myService.get_Ports().get_Count();
++i1) {
Console.WriteLine("Port[" + i1 + "] : "
+ myPortCollection.get_Item(i1).get_Name());
}
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: