2 // System.Web.Services.Protocols.SoapException.cs
5 // Tim Coleman (tim@timcoleman.com)
6 // Lluis Sanchez Gual (lluis@novell.com)
8 // Copyright (C) Tim Coleman, 2002
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 namespace System
.Web
.Services
.Protocols
37 public class SoapException
: SystemException
41 public static readonly XmlQualifiedName ClientFaultCode
= new XmlQualifiedName ("Client", "http://schemas.xmlsoap.org/soap/envelope/");
42 public static readonly XmlQualifiedName DetailElementName
= new XmlQualifiedName ("detail");
43 public static readonly XmlQualifiedName MustUnderstandFaultCode
= new XmlQualifiedName ("MustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");
44 public static readonly XmlQualifiedName ServerFaultCode
= new XmlQualifiedName ("Server", "http://schemas.xmlsoap.org/soap/envelope/");
45 public static readonly XmlQualifiedName VersionMismatchFaultCode
= new XmlQualifiedName ("VersionMismatch", "http://schemas.xmlsoap.org/soap/envelope/");
48 XmlQualifiedName code
;
54 SoapFaultSubcode subcode
;
60 public SoapException (string message
, XmlQualifiedName code
)
66 public SoapException (string message
, XmlQualifiedName code
, Exception innerException
)
67 : base (message
, innerException
)
72 public SoapException (string message
, XmlQualifiedName code
, string actor
)
79 public SoapException (string message
, XmlQualifiedName code
, string actor
, Exception innerException
)
80 : base (message
, innerException
)
86 public SoapException (string message
, XmlQualifiedName code
, string actor
, XmlNode detail
)
94 public SoapException (string message
, XmlQualifiedName code
, string actor
, XmlNode detail
, Exception innerException
)
95 : base (message
, innerException
)
103 public SoapException (string message
, XmlQualifiedName code
, SoapFaultSubcode subcode
)
107 this.subcode
= subcode
;
110 public SoapException (string message
, XmlQualifiedName code
, string actor
, string role
, XmlNode detail
, SoapFaultSubcode subcode
, Exception innerException
)
111 : base (message
, innerException
)
114 this.subcode
= subcode
;
115 this.detail
= detail
;
120 public SoapException (string message
, XmlQualifiedName code
, string actor
, string role
, string lang
, XmlNode detail
, SoapFaultSubcode subcode
, Exception innerException
)
123 this.subcode
= subcode
;
124 this.detail
= detail
;
130 public static bool IsClientFaultCode (XmlQualifiedName code
)
132 if (code
== ClientFaultCode
) return true;
133 if (code
== Soap12FaultCodes
.SenderFaultCode
) return true;
137 public static bool IsMustUnderstandFaultCode (XmlQualifiedName code
)
139 if (code
== MustUnderstandFaultCode
) return true;
140 if (code
== Soap12FaultCodes
.MustUnderstandFaultCode
) return true;
144 public static bool IsServerFaultCode (XmlQualifiedName code
)
146 if (code
== ServerFaultCode
) return true;
147 if (code
== Soap12FaultCodes
.ReceiverFaultCode
) return true;
151 public static bool IsVersionMismatchFaultCode (XmlQualifiedName code
)
153 if (code
== VersionMismatchFaultCode
) return true;
154 if (code
== Soap12FaultCodes
.VersionMismatchFaultCode
) return true;
160 #endregion // Constructors
164 public string Actor
{
165 get { return actor; }
168 public XmlQualifiedName Code
{
172 public XmlNode Detail
{
173 get { return detail; }
177 [System
.Runtime
.InteropServices
.ComVisible(false)]
182 [System
.Runtime
.InteropServices
.ComVisible(false)]
187 [System
.Runtime
.InteropServices
.ComVisible(false)]
188 public SoapFaultSubcode Subcode
{
189 get { return subcode; }
192 // Same value as actor
193 [System
.Runtime
.InteropServices
.ComVisible(false)]
195 get { return actor; }
198 #endregion // Properties