OperationCollectionとは? わかりやすく解説

OperationCollection クラス

Operation クラスインスタンスコレクション表します。このクラス継承できません。

名前空間: System.Web.Services.Description
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public NotInheritable Class
 OperationCollection
    Inherits ServiceDescriptionBaseCollection
Dim instance As OperationCollection
public sealed class OperationCollection : ServiceDescriptionBaseCollection
public ref class OperationCollection sealed
 : public ServiceDescriptionBaseCollection
public final class OperationCollection extends
 ServiceDescriptionBaseCollection
public final class OperationCollection extends
 ServiceDescriptionBaseCollection
解説解説
使用例使用例

OperationCollection クラスによって公開されるプロパティメソッド使用する例を次に示します

Option Strict On
Imports System
Imports System.Web.Services
Imports System.Xml
Imports System.Web.Services.Description

Class MyOperationCollectionSample
   Public Shared Sub Main()
      Try
         ' Read the 'MathService_Input_vb.wsdl' file.
         Dim myDescription As ServiceDescription
 = _
                        ServiceDescription.Read("MathService_Input_vb.wsdl")
         Dim myPortTypeCollection As PortTypeCollection
 = _
                                                   myDescription.PortTypes
         ' Get the 'OperationCollection' for 'SOAP' protocol.
         Dim myOperationCollection As OperationCollection
 = _
                                         myPortTypeCollection(0).Operations
         Dim myOperation As New
 Operation()
         myOperation.Name = "Add"
         Dim myOperationMessageInput As OperationMessage
 = _
                              CType(New OperationInput(), OperationMessage)
         myOperationMessageInput.Message = New XmlQualifiedName
 _
                              ("AddSoapIn", myDescription.TargetNamespace)
         Dim myOperationMessageOutput As OperationMessage
 = _
                              CType(New OperationOutput(), OperationMessage)
         myOperationMessageOutput.Message = New XmlQualifiedName
 _
                              ("AddSoapOut", myDescription.TargetNamespace)
         myOperation.Messages.Add(myOperationMessageInput)
         myOperation.Messages.Add(myOperationMessageOutput)
         myOperationCollection.Add(myOperation)

         If myOperationCollection.Contains(myOperation) = True
 Then
            Console.WriteLine("The index of the added 'myOperation'
 " + _
                     "operation is : " + _
                     myOperationCollection.IndexOf(myOperation).ToString)
         End If

         myOperationCollection.Remove(myOperation)
         ' Insert the 'myOpearation' operation at the index '0'.
         myOperationCollection.Insert(0, myOperation)
         Console.WriteLine("The operation at index '0' is : "
 + _
                           myOperationCollection.Item(0).Name)

         Dim myOperationArray(myOperationCollection.Count) As
 Operation
         myOperationCollection.CopyTo(myOperationArray, 0)
         Console.WriteLine("The operation(s) in the collection
 are :")
         Dim i As Integer
         For i = 0 To myOperationCollection.Count
 - 1
            Console.WriteLine(" " + myOperationArray(i).Name)
         Next i

         myDescription.Write("MathService_New_vb.wsdl")
      Catch e As Exception
         Console.WriteLine("Exception caught!!!")
         Console.WriteLine("Source : " + e.Source)
         Console.WriteLine("Message : " + e.Message)
      End Try
   End Sub
End Class
using System;
using System.Web.Services;
using System.Xml;
using System.Web.Services.Description;

class MyOperationCollectionSample
{
   public static void Main()
   {
      try
      {
         // Read the 'MathService_Input_cs.wsdl' file.
         ServiceDescription myDescription = 
                     ServiceDescription.Read("MathService_Input_cs.wsdl");
         PortTypeCollection myPortTypeCollection =myDescription.PortTypes;
         // Get the 'OperationCollection' for 'SOAP' protocol.
         OperationCollection myOperationCollection = 
                                       myPortTypeCollection[0].Operations;
         Operation myOperation = new Operation();
         myOperation.Name = "Add";
         OperationMessage myOperationMessageInput = 
                                  (OperationMessage) new OperationInput();
         myOperationMessageInput.Message = new XmlQualifiedName
                              ("AddSoapIn",myDescription.TargetNamespace);
         OperationMessage myOperationMessageOutput = 
                                 (OperationMessage) new OperationOutput();
         myOperationMessageOutput.Message = new XmlQualifiedName(
                              "AddSoapOut",myDescription.TargetNamespace);
         myOperation.Messages.Add(myOperationMessageInput);
         myOperation.Messages.Add(myOperationMessageOutput);
         myOperationCollection.Add(myOperation);

         if(myOperationCollection.Contains(myOperation) == true)
         {
            Console.WriteLine("The index of the added 'myOperation' " +
                              "operation is : " +
                              myOperationCollection.IndexOf(myOperation));
         }

         myOperationCollection.Remove(myOperation);
         // Insert the 'myOpearation' operation at the index '0'.
         myOperationCollection.Insert(0, myOperation);
         Console.WriteLine("The operation at index '0' is : " +
                           myOperationCollection[0].Name);

         Operation[] myOperationArray = new Operation[
                                             myOperationCollection.Count];
         myOperationCollection.CopyTo(myOperationArray, 0);
         Console.WriteLine("The operation(s) in the collection
 are :");
         for(int i = 0; i < myOperationCollection.Count;
 i++)
         {
            Console.WriteLine(" " + myOperationArray[i].Name);
         }

         myDescription.Write("MathService_New_cs.wsdl");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }
}
#using <System.dll>
#using <System.Xml.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Web::Services;
using namespace System::Xml;
using namespace System::Web::Services::Description;
int main()
{
   try
   {
      // Read the 'MathService_Input_cs.wsdl' file.
      ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_Input_cs.wsdl"
 );
      PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes;

      // Get the 'OperationCollection' for 'SOAP' protocol.

      OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations;
      Operation^ myOperation = gcnew Operation;
      myOperation->Name = "Add";
      OperationMessage^ myOperationMessageInput = (OperationMessage^)(gcnew OperationInput);
      myOperationMessageInput->Message = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace
 );
      OperationMessage^ myOperationMessageOutput = (OperationMessage^)(gcnew OperationOutput);
      myOperationMessageOutput->Message = gcnew XmlQualifiedName( "AddSoapOut",myDescription->TargetNamespace
 );
      myOperation->Messages->Add( myOperationMessageInput );
      myOperation->Messages->Add( myOperationMessageOutput );
      myOperationCollection->Add( myOperation );

      if ( myOperationCollection->Contains( myOperation ) ==
 true )
      {
         Console::WriteLine( "The index of the added 'myOperation' operation
 is : {0}", myOperationCollection->IndexOf( myOperation ) );
      }

      myOperationCollection->Remove( myOperation );
      
      // Insert the 'myOpearation' operation at the index '0'.
      myOperationCollection->Insert( 0, myOperation );
      Console::WriteLine( "The operation at index '0' is : {0}", myOperationCollection[
 0 ]->Name );

      array<Operation^>^myOperationArray = gcnew array<Operation^>(myOperationCollection->Count);
      myOperationCollection->CopyTo( myOperationArray, 0 );
      Console::WriteLine( "The operation(s) in the collection
 are :" );
      for ( int i = 0; i < myOperationCollection->Count;
 i++ )
      {
         Console::WriteLine( " {0}", myOperationArray[ i ]->Name );
      }

      myDescription->Write( "MathService_New_cs.wsdl" );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception caught!!!" );
      Console::WriteLine( "Source : {0}", e->Source );
      Console::WriteLine( "Message : {0}", e->Message );
   }
}
import System.*;  
import System.Web.Services.*;  
import System.Xml.*;  
import System.Web.Services.Description.*;  

class MyOperationCollectionSample
{
    public static void main(String[]
 args)
    {
        try {
            // Read the 'MathService_Input_jsl.wsdl' file.
            ServiceDescription myDescription = ServiceDescription.
                Read("MathService_Input_jsl.wsdl");
            PortTypeCollection myPortTypeCollection = myDescription.
                get_PortTypes();
            // Get the 'OperationCollection' for 'SOAP' protocol.
            OperationCollection myOperationCollection = myPortTypeCollection.
                get_Item(0).get_Operations();
            Operation myOperation = new Operation();
            myOperation.set_Name("Add");
            OperationMessage myOperationMessageInput = (OperationMessage)
                new OperationInput();
            myOperationMessageInput.set_Message(new XmlQualifiedName(
                "AddSoapIn", myDescription.get_TargetNamespace()));
            OperationMessage myOperationMessageOutput = (OperationMessage)
                new OperationOutput();
            myOperationMessageOutput.set_Message(new XmlQualifiedName(
                "AddSoapOut", myDescription.get_TargetNamespace()));
            myOperation.get_Messages().Add(myOperationMessageInput);
            myOperation.get_Messages().Add(myOperationMessageOutput);
            myOperationCollection.Add(myOperation);
            if (myOperationCollection.Contains(myOperation) ==
 true) {
                Console.WriteLine("The index of the added 'myOperation' "
 
                    + "operation is : " 
                    + myOperationCollection.IndexOf(myOperation));
            }
            myOperationCollection.Remove(myOperation);
            // Insert the 'myOpearation' operation at the index '0'.
            myOperationCollection.Insert(0, myOperation);
            Console.WriteLine("The operation at index '0' is : " 
                + myOperationCollection.get_Item(0).get_Name());
            Operation myOperationArray[] = new Operation[myOperationCollection.
                get_Count()];
            myOperationCollection.CopyTo(myOperationArray, 0);
            Console.WriteLine("The operation(s) in the collection
 are :");
            for (int i = 0; i < myOperationCollection.get_Count();
 i++) {
                Console.WriteLine(" " + myOperationArray[i].get_Name());
            }
            myDescription.Write("MathService_New_jsl.wsdl");
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception caught!!!");
            Console.WriteLine("Source : " + e.get_Source());
            Console.WriteLine("Message : " + e.get_Message());
        }
    } //main
} //MyOperationCollectionSample
継承階層継承階層
System.Object
   System.Collections.CollectionBase
     System.Web.Services.Description.ServiceDescriptionBaseCollection
      System.Web.Services.Description.OperationCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OperationCollection メンバ
System.Web.Services.Description 名前空間

OperationCollection プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ Capacity  CollectionBase に格納できる要素の数を取得または設定します。 ( CollectionBase から継承されます。)
パブリック プロパティ Count  CollectionBase インスタンス格納されている要素の数を取得します。このプロパティオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック プロパティ Item 指定した 0 から始まるインデックス番号にある Operation の値を取得または設定します
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素リスト格納する ArrayList を取得します。 ( CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素リスト格納する IList を取得します。 ( CollectionBase から継承されます。)
参照参照

関連項目

OperationCollection クラス
System.Web.Services.Description 名前空間

OperationCollection メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Operation を OperationCollection の末尾追加します
パブリック メソッド Clear  CollectionBase インスタンスかすべてのオブジェクト削除します。このメソッドオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック メソッド Contains 指定した OperationOperationCollectionメンバかどうかを示す値を返します
パブリック メソッド CopyTo OperationCollection 全体互換性のある Operation 型の 1 次元配列コピーしますコピーは、コピー先の配列の、指定した 0 から始まるインデックス番号から開始します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetEnumerator  CollectionBase インスタンス反復処理する列挙子を返します。 ( CollectionBase から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IndexOf 指定した Operation検索しコレクション内で最初に見つかった位置の 0 から始まるインデックス番号返します
パブリック メソッド Insert 指定した 0 から始まるインデックス番号にある OperationCollection に、指定した Operation追加します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド Remove OperationCollection 内で最初に見つかった指定Operation削除します
パブリック メソッド RemoveAt  CollectionBase インスタンス指定したインデックスにある要素削除します。このメソッドオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 ( Object から継承されます。)
プロテクト メソッド OnClear  CollectionBase インスタンス内容消去するときに、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnClearComplete  CollectionBase インスタンス内容消去した後に、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnInsert  CollectionBase インスタンス新し要素挿入する前に追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnInsertComplete  CollectionBase インスタンス新し要素挿入した後に、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnRemove  CollectionBase インスタンスか要素削除するときに、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnRemoveComplete  CollectionBase インスタンスか要素削除した後に、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnSet  CollectionBase インスタンスに値を設定する前に追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnSetComplete  CollectionBase インスタンスに値を設定した後に、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnValidate  値を検証するときに、追加カスタム プロセス実行します。 ( CollectionBase から継承されます。)
参照参照

関連項目

OperationCollection クラス
System.Web.Services.Description 名前空間

OperationCollection メンバ

Operation クラスインスタンスコレクション表します。このクラス継承できません。

OperationCollection データ型公開されるメンバを以下の表に示します


パブリック プロパティパブリック プロパティ
( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ Capacity  CollectionBase格納できる要素の数を取得または設定します。(CollectionBase から継承されます。)
パブリック プロパティ Count  CollectionBase インスタンス格納されている要素の数を取得します。このプロパティオーバーライドできません。(CollectionBase から継承されます。)
パブリック プロパティ Item 指定した 0 から始まるインデックス番号にある Operation の値を取得または設定します
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素リスト格納する ArrayList を取得します。(CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素リスト格納する IList を取得します。(CollectionBase から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Operation を OperationCollection の末尾追加します
パブリック メソッド Clear  CollectionBase インスタンスかすべてのオブジェクト削除します。このメソッドオーバーライドできません。 (CollectionBase から継承されます。)
パブリック メソッド Contains 指定した OperationOperationCollectionメンバかどうかを示す値を返します
パブリック メソッド CopyTo OperationCollection 全体互換性のある Operation 型の 1 次元配列コピーしますコピーは、コピー先の配列の、指定した 0 から始まるインデックス番号から開始します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetEnumerator  CollectionBase インスタンス反復処理する列挙子を返します。 (CollectionBase から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IndexOf 指定した Operation検索しコレクション内で最初に見つかった位置の 0 から始まるインデックス番号返します
パブリック メソッド Insert 指定した 0 から始まるインデックス番号にある OperationCollection に、指定した Operation追加します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド Remove OperationCollection 内で最初に見つかった指定Operation削除します
パブリック メソッド RemoveAt  CollectionBase インスタンス指定したインデックスにある要素削除します。このメソッドオーバーライドできません。 (CollectionBase から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド OnClear  CollectionBase インスタンス内容消去するときに、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnClearComplete  CollectionBase インスタンス内容消去した後に、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnInsert  CollectionBase インスタンス新し要素挿入する前に追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnInsertComplete  CollectionBase インスタンス新し要素挿入した後に、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnRemove  CollectionBase インスタンスか要素削除するときに、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnRemoveComplete  CollectionBase インスタンスか要素削除した後に、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnSet  CollectionBase インスタンスに値を設定する前に追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnSetComplete  CollectionBase インスタンスに値を設定した後に、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnValidate  値を検証するときに、追加カスタム プロセス実行します。 (CollectionBase から継承されます。)
参照参照

関連項目

OperationCollection クラス
System.Web.Services.Description 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「OperationCollection」の関連用語

OperationCollectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



OperationCollectionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS