SoapException クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)


SoapException は、共通言語ランタイムまたは XML Web サービス メソッドのいずれかによってスローされる場合があります。共通言語ランタイムは、要求に対する応答の書式が正しく設定されていない場合に SoapException をスローすることがあります。XML Web サービス メソッドは、XML Web サービス メソッド内で単に例外をスローすることによって SoapException を生成することがあります。クライアントが SOAP 経由でメソッドにアクセスした場合、例外はサーバーでキャッチされ、新しい SoapException 内にラップされます。スローされる SoapException には、次のプロパティ値があります。
値 | |
---|---|
ServerFaultCode | |
クライアントによる呼び出しで SOAP を使用している場合、XML Web サービス メソッドは SoapException をスローすることがあります。XML Web サービスが SoapException をスローする場合は、その他の詳細情報を Actor、Code、および Detail の各プロパティを使用して追加できます。別の種類の例外がスローされた場合は、XML Web サービス メソッドでこれらのプロパティを設定することはできません。

SoapException をスローする例を次に示します。この例では、XML Web サービス メソッドが Detail プロパティを設定します。
<%@ WebService Language="VB" class="ThrowSoapException"%> Imports System Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Xml.Serialization Imports System.Xml Public Class ThrowSoapException Inherits WebService ' This XML Web service method generates a SOAP Client Fault code <WebMethod()> _ Public Sub myThrow() ' Build the detail element of the SOAP fault. Dim doc As New System.Xml.XmlDocument() Dim node As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ SoapException.DetailElementName.Name, _ SoapException.DetailElementName.Namespace) ' Build specific details for the SoapException. ' Add first child of detail XML element. Dim details As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ "mySpecialInfo1", "http://tempuri.org/") ' Add second child of detail XML element with an attribute. Dim details2 As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ "mySpecialInfo2", "http://tempuri.org/") Dim attr As XmlAttribute = doc.CreateAttribute("t", "attrName", _ "http://tempuri.org/") attr.Value = "attrValue" details2.Attributes.Append(attr) ' Append the two child elements to the detail node. node.AppendChild(details) node.AppendChild(details2) 'Throw the exception Dim se As New SoapException("Fault occurred", SoapException.ClientFaultCode, _ Context.Request.Url.AbsoluteUri, node) Throw se Return End Sub End Class
<%@ WebService Language="C#" class="ThrowSoapException"%> using System; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Serialization; using System.Xml; public class ThrowSoapException : WebService { // This XML Web service method generates a SOAP Client Fault code [WebMethod] public void myThrow(){ // Build the detail element of the SOAP fault. System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlNode node = doc.CreateNode(XmlNodeType.Element, SoapException.DetailElementName.Name, SoapException.DetailElementName.Namespace); // Build specific details for the SoapException. // Add first child of detail XML element. System.Xml.XmlNode details = doc.CreateNode(XmlNodeType.Element, "mySpecialInfo1", "http://tempuri.org/"); System.Xml.XmlNode detailsChild = doc.CreateNode(XmlNodeType.Element, "childOfSpecialInfo", "http://tempuri.org/"); details.AppendChild(detailsChild); // Add second child of detail XML element with an attribute. System.Xml.XmlNode details2 = doc.CreateNode(XmlNodeType.Element, "mySpecialInfo2", "http://tempuri.org/"); XmlAttribute attr = doc.CreateAttribute("t", "attrName", "http://tempuri.org/"); attr.Value = "attrValue"; details2.Attributes.Append(attr); // Append the two child elements to the detail node. node.AppendChild(details); node.AppendChild(details2); //Throw the exception. SoapException se = new SoapException("Fault occurred", SoapException.ClientFaultCode,Context.Request.Url.AbsoluteUri,node); throw se; return; } }

System.Exception
System.SystemException
System.Web.Services.Protocols.SoapException
System.Web.Services.Protocols.SoapHeaderException


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ ()
アセンブリ: System.Web.Services (system.web.services.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String, Exception)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public Sub New ( _ message As String, _ code As XmlQualifiedName, _ actor As String, _ innerException As Exception _ )
Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim innerException As Exception Dim instance As New SoapException(message, code, actor, innerException)
public SoapException ( string message, XmlQualifiedName code, string actor, Exception innerException )
public: SoapException ( String^ message, XmlQualifiedName^ code, String^ actor, Exception^ innerException )
public SoapException ( String message, XmlQualifiedName code, String actor, Exception innerException )
public function SoapException ( message : String, code : XmlQualifiedName, actor : String, innerException : Exception )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String, XmlNode)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public Sub New ( _ message As String, _ code As XmlQualifiedName, _ actor As String, _ detail As XmlNode _ )
Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim detail As XmlNode Dim instance As New SoapException(message, code, actor, detail)
public function SoapException ( message : String, code : XmlQualifiedName, actor : String, detail : XmlNode )

<%@ WebService Language="VB" class="ThrowSoapException"%> Imports System Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Xml.Serialization Imports System.Xml Public Class ThrowSoapException Inherits WebService ' This XML Web service method generates a SOAP client fault code. <WebMethod()> _ Public Sub myThrow() ' Build the detail element of the SOAP fault. Dim doc As New System.Xml.XmlDocument() Dim node As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ SoapException.DetailElementName.Name, _ SoapException.DetailElementName.Namespace) ' Build specific details for the SoapException. ' Add first child of detail XML element. Dim details As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ "mySpecialInfo1", "http://tempuri.org/") ' Add second child of detail XML element with an attribute. Dim details2 As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ "mySpecialInfo2", "http://tempuri.org/") Dim attr As XmlAttribute = doc.CreateAttribute("t", "attrName", _ "http://tempuri.org/") attr.Value = "attrValue" details2.Attributes.Append(attr) ' Append the two child elements to the detail node. node.AppendChild(details) node.AppendChild(details2) ' Throw the exception. Dim se As New SoapException("Fault occurred", SoapException.ClientFaultCode, _ Context.Request.Url.AbsoluteUri, node) Throw se Return End Sub End Class
<%@ WebService Language="C#" class="ThrowSoapException"%> using System; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Serialization; using System.Xml; public class ThrowSoapException : WebService { // This XML Web service method generates a SOAP client fault code. [WebMethod] public void myThrow(){ // Build the detail element of the SOAP fault. System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlNode node = doc.CreateNode(XmlNodeType.Element, SoapException.DetailElementName.Name, SoapException.DetailElementName.Namespace); // Build specific details for the SoapException. // Add first child of detail XML element. System.Xml.XmlNode details = doc.CreateNode(XmlNodeType.Element, "mySpecialInfo1", "http://tempuri.org/"); System.Xml.XmlNode detailsChild = doc.CreateNode(XmlNodeType.Element, "childOfSpecialInfo", "http://tempuri.org/"); details.AppendChild(detailsChild); // Add second child of detail XML element with an attribute. System.Xml.XmlNode details2 = doc.CreateNode(XmlNodeType.Element, "mySpecialInfo2", "http://tempuri.org/"); XmlAttribute attr = doc.CreateAttribute("t", "attrName", "http://tempuri.org/"); attr.Value = "attrValue"; details2.Attributes.Append(attr); // Append the two child elements to the detail node. node.AppendChild(details); node.AppendChild(details2); //Throw the exception. SoapException se = new SoapException("Fault occurred", SoapException.ClientFaultCode,Context.Request.Url.AbsoluteUri,node); throw se; return; } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, SoapFaultSubCode)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim message As String Dim code As XmlQualifiedName Dim subCode As SoapFaultSubCode Dim instance As New SoapException(message, code, subCode)
public function SoapException ( message : String, code : XmlQualifiedName, subCode : SoapFaultSubCode )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String, XmlNode, Exception)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public Sub New ( _ message As String, _ code As XmlQualifiedName, _ actor As String, _ detail As XmlNode, _ innerException As Exception _ )
Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim detail As XmlNode Dim innerException As Exception Dim instance As New SoapException(message, code, actor, detail, innerException)
public SoapException ( string message, XmlQualifiedName code, string actor, XmlNode detail, Exception innerException )
public: SoapException ( String^ message, XmlQualifiedName^ code, String^ actor, XmlNode^ detail, Exception^ innerException )
public SoapException ( String message, XmlQualifiedName code, String actor, XmlNode detail, Exception innerException )
public function SoapException ( message : String, code : XmlQualifiedName, actor : String, detail : XmlNode, innerException : Exception )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String, String, XmlNode, SoapFaultSubCode, Exception)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public Sub New ( _ message As String, _ code As XmlQualifiedName, _ actor As String, _ role As String, _ detail As XmlNode, _ subCode As SoapFaultSubCode, _ innerException As Exception _ )
Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim role As String Dim detail As XmlNode Dim subCode As SoapFaultSubCode Dim innerException As Exception Dim instance As New SoapException(message, code, actor, role, detail, subCode, innerException)
public SoapException ( string message, XmlQualifiedName code, string actor, string role, XmlNode detail, SoapFaultSubCode subCode, Exception innerException )
public: SoapException ( String^ message, XmlQualifiedName^ code, String^ actor, String^ role, XmlNode^ detail, SoapFaultSubCode^ subCode, Exception^ innerException )
public SoapException ( String message, XmlQualifiedName code, String actor, String role, XmlNode detail, SoapFaultSubCode subCode, Exception innerException )
public function SoapException ( message : String, code : XmlQualifiedName, actor : String, role : String, detail : XmlNode, subCode : SoapFaultSubCode, innerException : Exception )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String, String, String, XmlNode, SoapFaultSubCode, Exception)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public Sub New ( _ message As String, _ code As XmlQualifiedName, _ actor As String, _ role As String, _ lang As String, _ detail As XmlNode, _ subCode As SoapFaultSubCode, _ innerException As Exception _ )
Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim role As String Dim lang As String Dim detail As XmlNode Dim subCode As SoapFaultSubCode Dim innerException As Exception Dim instance As New SoapException(message, code, actor, role, lang, detail, subCode, innerException)
public SoapException ( string message, XmlQualifiedName code, string actor, string role, string lang, XmlNode detail, SoapFaultSubCode subCode, Exception innerException )
public: SoapException ( String^ message, XmlQualifiedName^ code, String^ actor, String^ role, String^ lang, XmlNode^ detail, SoapFaultSubCode^ subCode, Exception^ innerException )
public SoapException ( String message, XmlQualifiedName code, String actor, String role, String lang, XmlNode detail, SoapFaultSubCode subCode, Exception innerException )
public function SoapException ( message : String, code : XmlQualifiedName, actor : String, role : String, lang : String, detail : XmlNode, subCode : SoapFaultSubCode, innerException : Exception )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (SerializationInfo, StreamingContext)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim info As SerializationInfo Dim context As StreamingContext Dim instance As New SoapException(info, context)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, String)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim message As String Dim code As XmlQualifiedName Dim actor As String Dim instance As New SoapException(message, code, actor)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ


SoapException コンストラクタ (String, XmlQualifiedName)
アセンブリ: System.Web.Services (system.web.services.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException コンストラクタ (String, XmlQualifiedName, Exception)
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim message As String Dim code As XmlQualifiedName Dim innerException As Exception Dim instance As New SoapException(message, code, innerException)
public function SoapException ( message : String, code : XmlQualifiedName, innerException : Exception )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapException フィールド
SoapException プロパティ

名前 | 説明 | |
---|---|---|
![]() ![]() ![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。 ( Exception から継承されます。) |
![]() ![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。 ( Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。 ( Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。 ( Exception から継承されます。) |
![]() ![]() ![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。 ( Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。 ( Exception から継承されます。) |
![]() ![]() | TargetSite | 現在の例外をスローするメソッドを取得します。 ( Exception から継承されます。) |


SoapException メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 ( Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetObjectData | オーバーライドされます。 SerializationInfo に例外情報を設定します。 |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 ( Exception から継承されます。) |
![]() | IsClientFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが Client SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | IsMustUnderstandFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが MustUnderstand と等価であるかどうかを示す値を返します。 |
![]() | IsServerFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが Server SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | IsVersionMismatchFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが VersionMismatch SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 ( Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

SoapException メンバ
XML Web サービス メソッドが SOAP 経由で呼び出され、例外が発生したときにスローされる例外を表します。
SoapException データ型で公開されるメンバを以下の表に示します。




名前 | 説明 | |
---|---|---|
![]() ![]() ![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。(Exception から継承されます。) |
![]() ![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。(Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。(Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。(Exception から継承されます。) |
![]() ![]() ![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。(Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。(Exception から継承されます。) |
![]() ![]() | TargetSite | 現在の例外をスローするメソッドを取得します。(Exception から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 (Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetObjectData | オーバーライドされます。 SerializationInfo に例外情報を設定します。 |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 (Exception から継承されます。) |
![]() | IsClientFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが Client SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | IsMustUnderstandFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが MustUnderstand と等価であるかどうかを示す値を返します。 |
![]() | IsServerFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが Server SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | IsVersionMismatchFaultCode | 使用している SOAP プロトコルのバージョンに関係なく、SOAP 違反コードが VersionMismatch SOAP 違反コードと等価であるかどうかを示す値を返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 (Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- SoapExceptionのページへのリンク