OperationFault クラス

定義

XML Web サービスから返されるエラー メッセージの仕様を定義します。 このクラスは継承できません。

public ref class OperationFault sealed : System::Web::Services::Description::OperationMessage
public sealed class OperationFault : System.Web.Services.Description.OperationMessage
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class OperationFault : System.Web.Services.Description.OperationMessage
type OperationFault = class
    inherit OperationMessage
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type OperationFault = class
    inherit OperationMessage
Public NotInheritable Class OperationFault
Inherits OperationMessage
継承
継承
属性

次の例では、 クラスによって公開されるプロパティとメソッドの使用方法を OperationFault 示します。

#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Xml;
using namespace System::Xml::Schema;
using namespace System::Xml::Serialization;
int main()
{
   try
   {
      // Read the 'StockQuote_cpp.wsdl' file as input.
      ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" );
      PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes;
      PortType^ myPortType = myPortTypeCollection[ 0 ];
      OperationCollection^ myOperationCollection = myPortType->Operations;
      Operation^ myOperation = myOperationCollection[ 0 ];
      
      OperationFault^ myOperationFault = gcnew OperationFault;
      myOperationFault->Name = "ErrorString";
      myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" );
      myOperation->Faults->Add( myOperationFault );
      Console::WriteLine( "Added OperationFault with Name: {0}", myOperationFault->Name );
      myOperationFault = gcnew OperationFault;
      myOperationFault->Name = "ErrorInt";
      myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceIntFault" );
      myOperation->Faults->Add( myOperationFault );

      myOperationCollection->Add( myOperation );
      Console::WriteLine( "Added Second OperationFault with Name: {0}", myOperationFault->Name );
      myServiceDescription->Write( "StockQuoteNew_cpp.wsdl" );
      Console::WriteLine( "\nThe file 'StockQuoteNew_cpp.wsdl' is created successfully." );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception caught!!!" );
      Console::WriteLine( "Source : {0}", e->Source );
      Console::WriteLine( "Message : {0}", e->Message );
   }
}
using System;
using System.Web.Services.Description;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

public class MyOperationFaultSample
{
   public static void Main()
   {
      try
      {
         // Read the 'StockQuote_cs.wsdl' file as input.
         ServiceDescription myServiceDescription = ServiceDescription.
                                               Read("StockQuote_cs.wsdl");
         PortTypeCollection myPortTypeCollection = myServiceDescription.
                                                                PortTypes;
         PortType myPortType = myPortTypeCollection[0];
         OperationCollection myOperationCollection = myPortType.Operations;
         Operation myOperation = myOperationCollection[0];
         OperationFault myOperationFault = new OperationFault();
         myOperationFault.Name = "ErrorString";
         myOperationFault.Message = new XmlQualifiedName
                                          ("s0:GetTradePriceStringFault");
         myOperation.Faults.Add(myOperationFault);
         Console.WriteLine("Added OperationFault with Name: "
                           + myOperationFault.Name);
         myOperationFault = new OperationFault();
         myOperationFault.Name = "ErrorInt";
         myOperationFault.Message = new XmlQualifiedName
                                             ("s0:GetTradePriceIntFault");
         myOperation.Faults.Add(myOperationFault);
         myOperationCollection.Add(myOperation);
         Console.WriteLine("Added Second OperationFault with Name: "
                  +myOperationFault.Name);
         myServiceDescription.Write("StockQuoteNew_cs.wsdl");
         Console.WriteLine("\nThe file 'StockQuoteNew_cs.wsdl' is " +
                           "created successfully.");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }
}
Imports System.Web.Services.Description
Imports System.Xml
Imports System.Xml.Schema
Imports System.Xml.Serialization

Public Class MyOperationFaultSample
   Public Shared Sub Main()
      Try
         ' Read the 'StockQuote_vb.wsdl' file as input.
         Dim myServiceDescription As ServiceDescription = _
                              ServiceDescription.Read("StockQuote_vb.wsdl")
         Dim myPortTypeCollection As PortTypeCollection = _
                                           myServiceDescription.PortTypes
         Dim myPortType As PortType = myPortTypeCollection(0)
         Dim myOperationCollection As OperationCollection = myPortType.Operations
         Dim myOperation As Operation = myOperationCollection(0)
         Dim myOperationFault As New OperationFault()
         myOperationFault.Name = "ErrorString"
         myOperationFault.Message = _
                        New XmlQualifiedName("s0:GetTradePriceStringFault")
         myOperation.Faults.Add(myOperationFault)
         Console.WriteLine("Added OperationFault with Name: " + _
                                                     myOperationFault.Name)
         myOperationFault = New OperationFault()
         myOperationFault.Name = "ErrorInt"
         myOperationFault.Message = _
                           New XmlQualifiedName("s0:GetTradePriceIntFault")
         myOperation.Faults.Add(myOperationFault)
         myOperationCollection.Add(myOperation)
         Console.WriteLine("Added Second OperationFault with Name: " + _
                                                    myOperationFault.Name)
         myServiceDescription.Write("StockQuoteNew_vb.wsdl")
         Console.WriteLine(ControlChars.NewLine + _
                           "The file 'StockQuoteNew_vb.wsdl' is " + _
                           "created successfully.")
      Catch e As Exception
         Console.WriteLine("Exception caught!!!")
         Console.WriteLine("Source : " + e.Source)
         Console.WriteLine("Message : " + e.Message)
      End Try
   End Sub
End Class

注釈

このクラスのインスタンスは、親Operationインスタンスの Faults プロパティのメンバーです。

クラスはOperationFault、要素で囲まれた operation Web サービス記述言語 (WSDL) fault 要素に対応し、 要素で囲まれますportType。 WSDL の詳細については、WSDL 仕様を参照してください。

コンストラクター

OperationFault()

OperationFault クラスの新しいインスタンスを初期化します。

プロパティ

Documentation

DocumentableItem のインスタンスのテキスト ドキュメントを取得または設定します。

(継承元 DocumentableItem)
DocumentationElement

DocumentableItem のドキュメント要素を取得または設定します。

(継承元 DocumentableItem)
ExtensibleAttributes

Web Services Interoperability (WS-I) Basic Profile 1.1 に準拠する WSDL の属性の拡張機能を表す XmlAttribute 型の配列を取得または設定します。

(継承元 DocumentableItem)
Extensions

この ServiceDescriptionFormatExtensionCollection に関連付けられている OperationFault を取得します。

Extensions

この ServiceDescriptionFormatExtensionCollection に関連付けられている DocumentableItem を取得します。

(継承元 DocumentableItem)
Message

通信データの抽象的な型定義を取得または設定します。

(継承元 OperationMessage)
Name

OperationMessage の名前を取得または設定します。

(継承元 OperationMessage)
Namespaces

ServiceDescription オブジェクトが生成されるときに名前空間プレフィックスと名前空間を保持するために使用する、名前空間プレフィックスと名前空間のディクショナリを取得または設定します。

(継承元 DocumentableItem)
Operation

Operation がメンバーとして含まれている OperationMessage を取得します。

(継承元 OperationMessage)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください