PortTypeCollection.Item プロパティ
渡されたパラメータによって指定された PortType を取得または設定します。
[C#] C# では、このプロパティは PortTypeCollection クラスのインデクサになります。
オーバーロードの一覧
指定の 0 から始まるインデックス番号に対応する PortType の値を取得または設定します。
[Visual Basic] Overloads Public Default Property Item(Integer) As PortType
[C++] public: __property PortType* get_Item(int);
public: __property void set_Item(int, PortType*);
[JScript] PortTypeCollection.Item (int)
Name プロパティによって指定された PortType を取得します。
[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As PortType
[JScript] PortTypeCollection.Item (String)
使用例
[Visual Basic, C#, C++] メモ ここでは、Item プロパティ (PortTypeCollection インデクサ) のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
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")
[C#]
ServiceDescription myServiceDescription =
ServiceDescription.Read("MathService_CS.wsdl");
PortTypeCollection myPortTypeCollection =
myServiceDescription.PortTypes;
int noOfPortTypes = myServiceDescription.PortTypes.Count;
Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes);
PortType myNewPortType = myPortTypeCollection["MathServiceSoap"];
[C++]
ServiceDescription* myServiceDescription =
ServiceDescription::Read(S"MathService_CS.wsdl");
PortTypeCollection* myPortTypeCollection =
myServiceDescription->PortTypes;
int noOfPortTypes = myServiceDescription->PortTypes->Count;
Console::WriteLine(S"\nTotal number of PortTypes: {0}", __box(noOfPortTypes));
PortType* myNewPortType = myPortTypeCollection->Item[S"MathServiceSoap"];
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
参照
PortTypeCollection クラス | PortTypeCollection メンバ | System.Web.Services.Description 名前空間