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

Operation クラス

XML Web サービスサポートされアクション抽象定義を提供します。このクラス継承できません。

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

Public NotInheritable Class
 Operation
    Inherits NamedItem
public sealed class Operation : NamedItem
public ref class Operation sealed : public
 NamedItem
public final class Operation extends NamedItem
public final class Operation extends
 NamedItem
解説解説

Operation クラスは、portType 要素囲まれWSDL (Web Services Description Language) operation 要素対応しますWSDL詳細については、http://www.w3.org/TR/wsdl/ の仕様参照してください

使用例使用例

Operation クラス一般的な使用例を次に示します。この例では、HTTP POST プロトコルサポートする PortType を持たない ServiceDescription を使用します続いてPOSTサポートする PortTypeインスタンス追加し新しWSDL コントラクト出力します

Imports System
Imports System.Web.Services.Description
Imports System.Collections
Imports System.Xml

Class MyOperationClass
   
   Public Shared Sub Main()
      Dim myDescription As ServiceDescription
 = ServiceDescription.Read("Operation_5_Input_VB.wsdl")
      ' Create a 'PortType' object.
      Dim myPortType As New
 PortType()
      myPortType.Name = "OperationServiceHttpPost"
      Dim myOperation As Operation = CreateOperation("AddNumbers",
 "s0:AddNumbersHttpPostIn", _
                                                                     "s0:AddNumbersHttpPostOut")
      myPortType.Operations.Add(myOperation)
      ' Get the PortType of the Operation. 
      Dim myPort As PortType = myOperation.PortType
        Console.WriteLine( _
           "The port type of the operation is: " &
 myPort.Name)
      ' Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'.
      myDescription.PortTypes.Add(myPortType)
      
      ' Write the 'ServiceDescription' as a WSDL file.
      myDescription.Write("Operation_5_Output_VB.wsdl")
      Console.WriteLine("WSDL file with name 'Operation_5_Output_VB.wsdl'"
 + _ 
                           "file created Successfully")
   End Sub 'Main
   
   Public Shared Function
 CreateOperation(myOperationName As String,
 myInputMesg As String, _
                                                         myOutputMesg As
 String) As Operation
      ' Create an Operation.
      Dim myOperation As New
 Operation()
      myOperation.Name = myOperationName
      Dim myInput As OperationMessage = _
         CType(New OperationInput(), OperationMessage)
      myInput.Message = New XmlQualifiedName(myInputMesg)
      Dim myOutput As OperationMessage = _
         CType(New OperationOutput(), OperationMessage)
      myOutput.Message = New XmlQualifiedName(myOutputMesg)

      ' Add messages to the OperationMessageCollection.
      myOperation.Messages.Add(myInput)
      myOperation.Messages.Add(myOutput)
      Console.WriteLine("Operation name is: " &
 myOperation.Name)
      Return myOperation
   End Function 'CreateOperation
 
End Class 'MyOperationClass 
using System;
using System.Web.Services.Description;
using System.Collections;
using System.Xml;

class MyOperationClass
{
   public static void Main()
   {
      ServiceDescription myDescription = ServiceDescription.Read("Operation_5_Input_CS.wsdl");
      // Create a 'PortType' object.
      PortType myPortType = new PortType();
      myPortType.Name = "OperationServiceHttpPost";
      Operation myOperation = CreateOperation
                         ("AddNumbers","s0:AddNumbersHttpPostIn","s0:AddNumbersHttpPostOut");
    
      myPortType.Operations.Add(myOperation);
      // Get the PortType of the Operation. 
      PortType myPort = myOperation.PortType;
      Console.WriteLine(
         "The port type of the operation is: " + myPort.Name);
      // Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'.
      myDescription.PortTypes.Add(myPortType);
      
      // Write the 'ServiceDescription' as a WSDL file.
      myDescription.Write("Operation_5_Output_CS.wsdl");
      Console.WriteLine("WSDL file with name 'Operation_5_Output_CS.wsdl' file
 created Successfully");
   }
   public static Operation CreateOperation(string
 myOperationName,string myInputMesg,string
 myOutputMesg)
   {
      // Create an Operation.
      Operation myOperation = new Operation();
      myOperation.Name = myOperationName;
      OperationMessage myInput = (OperationMessage)new OperationInput();
      myInput.Message =  new XmlQualifiedName(myInputMesg);
      OperationMessage myOutput = (OperationMessage)new OperationOutput();
      myOutput.Message = new XmlQualifiedName(myOutputMesg);

      // Add messages to the OperationMessageCollection.
      myOperation.Messages.Add(myInput);
      myOperation.Messages.Add(myOutput);
      Console.WriteLine("Operation name is: " + myOperation.Name);    
 
      return myOperation;
   }
}
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;
Operation^ CreateOperation( String^ myOperationName, String^ myInputMesg, String^
 myOutputMesg )
{
   
   // Create an Operation.
   Operation^ myOperation = gcnew Operation;
   myOperation->Name = myOperationName;
   OperationMessage^ myInput = dynamic_cast<OperationMessage^>(gcnew OperationInput);
   myInput->Message = gcnew XmlQualifiedName( myInputMesg );
   OperationMessage^ myOutput = dynamic_cast<OperationMessage^>(gcnew OperationOutput);
   myOutput->Message = gcnew XmlQualifiedName( myOutputMesg );
   
   // Add messages to the OperationMessageCollection.
   myOperation->Messages->Add( myInput );
   myOperation->Messages->Add( myOutput );
   Console::WriteLine( "Operation name is: {0}", myOperation->Name );
   
   return myOperation;
}

int main()
{
   ServiceDescription^ myDescription = ServiceDescription::Read( "Operation_5_Input_CS.wsdl"
 );
   
   // Create a 'PortType' object.
   PortType^ myPortType = gcnew PortType;
   myPortType->Name = "OperationServiceHttpPost";
   Operation^ myOperation = CreateOperation( "AddNumbers", "s0:AddNumbersHttpPostIn",
 "s0:AddNumbersHttpPostOut" );
   myPortType->Operations->Add( myOperation );
   
   // Get the PortType of the Operation. 
   PortType^ myPort = myOperation->PortType;
   Console::WriteLine( "The port type of the operation is: {0}", myPort->Name
 );
   
   // Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'.
   myDescription->PortTypes->Add( myPortType );
   
   // Write the 'ServiceDescription' as a WSDL file.
   myDescription->Write( "Operation_5_Output_CS.wsdl" );
   Console::WriteLine( "WSDL file with name 'Operation_5_Output_CS.wsdl' file
 created Successfully" );
}

import System.*;  
import System.Web.Services.Description.*;  
import System.Collections.*;  
import System.Xml.*;  

class MyOperationClass
{
    public static void main(String[]
 args)
    {
        ServiceDescription myDescription = ServiceDescription.
            Read("Operation_5_Input_JSL.wsdl");
        // Create a 'PortType' object.
        PortType myPortType = new PortType();
        myPortType.set_Name("OperationServiceHttpPost");
        Operation myOperation = CreateOperation("AddNumbers", 
            "s0:AddNumbersHttpPostIn", "s0:AddNumbersHttpPostOut");
        myPortType.get_Operations().Add(myOperation);
        // Get the PortType of the Operation. 
        PortType myPort = myOperation.get_PortType();
        Console.WriteLine("The port type of the operation is: " 
            + myPort.get_Name());
        // Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'.
        myDescription.get_PortTypes().Add(myPortType);
        // Write the 'ServiceDescription' as a WSDL file.
        myDescription.Write("Operation_5_Output_JSL.wsdl");
        Console.WriteLine("WSDL file with name 'Operation_5_Output_JSL.wsdl'
 "
            + "file created Successfully");
    } //main

    public static Operation CreateOperation(String
 myOperationName, 
        String myInputMesg, String myOutputMesg)
    {
        // Create an Operation.
        Operation myOperation = new Operation();
        myOperation.set_Name(myOperationName);
        OperationMessage myInput = (OperationMessage)new OperationInput();
        myInput.set_Message(new XmlQualifiedName(myInputMesg));
        OperationMessage myOutput = (OperationMessage)new OperationOutput();
        myOutput.set_Message(new XmlQualifiedName(myOutputMesg));
        // Add messages to the OperationMessageCollection.
        myOperation.get_Messages().Add(myInput);
        myOperation.get_Messages().Add(myOutput);
        Console.WriteLine("Operation name is: " + myOperation.get_Name());
        return myOperation;
    } //CreateOperation
} //MyOperationClass
継承階層継承階層
System.Object
   System.Web.Services.Description.DocumentableItem
     System.Web.Services.Description.NamedItem
      System.Web.Services.Description.Operation
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Operation メンバ
System.Web.Services.Description 名前空間
PortType

Operation コンストラクタ


Operation プロパティ


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

  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンステキスト ドキュメント取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItemドキュメント要素取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1準拠する WSDL属性拡張機能を表す XmlAttribute 型の配列取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされます。 この Operation に関連付けられている ServiceDescriptionFormatExtensionCollection を取得します
パブリック プロパティ Faults 現在の Operation定義されている違反またはエラー メッセージコレクション取得します
パブリック プロパティ Messages 現在の Operation定義されている Message クラスインスタンスコレクション取得します
パブリック プロパティ Name  項目の名前を取得または設定します。 ( NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクト生成されるときに名前空間プレフィックス名前空間保持するために使用する名前空間プレフィックス名前空間のディクショナリを取得または設定します。 ( DocumentableItem から継承されます。)
パブリック プロパティ ParameterOrder ParameterOrderString 内に含まれる要素配列取得または設定します
パブリック プロパティ ParameterOrderString 要求応答操作または請求応答操作に関する仕様指示するオプションリモート プロシージャ コール (RPC: Remote Procedure Call) シグニチャを取得または設定します
パブリック プロパティ PortType Operationメンバとして含まれている PortType を取得します
参照参照

関連項目

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

Operation メソッド


Operation メンバ

XML Web サービスサポートされアクション抽象定義を提供します。このクラス継承できません。

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド Operation  
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Documentation  DocumentableItem のインスタンステキスト ドキュメント取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ DocumentationElement  DocumentableItemドキュメント要素取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ ExtensibleAttributes  Web Services Interoperability (WS-I) Basic Profile 1.1準拠する WSDL属性拡張機能を表す XmlAttribute 型の配列取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ Extensions オーバーライドされます。 この Operation関連付けられている ServiceDescriptionFormatExtensionCollection を取得します
パブリック プロパティ Faults 現在の Operation定義されている違反またはエラー メッセージコレクション取得します
パブリック プロパティ Messages 現在の Operation定義されている Message クラスインスタンスコレクション取得します
パブリック プロパティ Name  項目の名前を取得または設定します。(NamedItem から継承されます。)
パブリック プロパティ Namespaces  ServiceDescription オブジェクト生成されるときに名前空間プレフィックス名前空間保持するために使用する名前空間プレフィックス名前空間のディクショナリを取得または設定します。(DocumentableItem から継承されます。)
パブリック プロパティ ParameterOrder ParameterOrderString 内に含まれる要素配列取得または設定します
パブリック プロパティ ParameterOrderString 要求応答操作または請求応答操作に関する仕様指示するオプションリモート プロシージャ コール (RPC: Remote Procedure Call) シグニチャを取得または設定します
パブリック プロパティ PortType Operationメンバとして含まれている PortType を取得します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

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


このページでは「.NET Framework クラス ライブラリ リファレンス」からoperationを検索した結果を表示しています。
Weblioに収録されているすべての辞書からoperationを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からoperation を検索

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

「operation」に関係したコラム

辞書ショートカット

すべての辞書の索引

「operation」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS