次の方法で共有


PortTypeCollection.Item プロパティ (String)

Name プロパティによって指定された PortType を取得します。

[C#] C# では、このプロパティは PortTypeCollection クラスのインデクサになります。

Overloads Public Default ReadOnly Property Item( _
   ByVal name As String _) As PortType
[C#]
public PortType this[stringname] {get;}
[C++]
public: __property PortType* get_Item(String* name);
[JScript]
returnValue = PortTypeCollectionObject.Item(name);またはreturnValue = PortTypeCollectionObject(name);

[JScript] JScript では、この型で定義されている既定のインデックス プロパティを使用することができます。しかし、独自のインデックス プロパティを明示的に定義することはできません。ただし、このクラスの expando 属性を指定すると、既定のインデックス プロパティが提供されます。提供されるインデックス プロパティの型は Object 型であり、インデックス型は String になります。

引数 [JScript]

  • name
    返される PortType の名前。

パラメータ [Visual Basic, C#, C++]

  • name
    返される PortType の名前。

プロパティ値

value パラメータの名前。

例外

例外の種類 条件
InvalidCastException value パラメータは、 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")

[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++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

PortTypeCollection クラス | PortTypeCollection メンバ | System.Web.Services.Description 名前空間 | PortTypeCollection.Item オーバーロードの一覧