2 // System.Web.Services.Protocols.SoapException.cs
\r
5 // Tim Coleman (tim@timcoleman.com)
\r
6 // Lluis Sanchez Gual (lluis@novell.com)
\r
8 // Copyright (C) Tim Coleman, 2002
\r
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
\r
37 public class SoapException : SystemException
\r
41 public static readonly XmlQualifiedName ClientFaultCode = new XmlQualifiedName ("Client", "http://schemas.xmlsoap.org/soap/envelope/");
\r
42 public static readonly XmlQualifiedName DetailElementName = new XmlQualifiedName ("detail");
\r
43 public static readonly XmlQualifiedName MustUnderstandFaultCode = new XmlQualifiedName ("MustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");
\r
44 public static readonly XmlQualifiedName ServerFaultCode = new XmlQualifiedName ("Server", "http://schemas.xmlsoap.org/soap/envelope/");
\r
45 public static readonly XmlQualifiedName VersionMismatchFaultCode = new XmlQualifiedName ("VersionMismatch", "http://schemas.xmlsoap.org/soap/envelope/");
\r
48 XmlQualifiedName code;
\r
54 SoapFaultSubcode subcode;
\r
58 #region Constructors
\r
60 public SoapException (string message, XmlQualifiedName code)
\r
66 public SoapException (string message, XmlQualifiedName code, Exception innerException)
\r
67 : base (message, innerException)
\r
72 public SoapException (string message, XmlQualifiedName code, string actor)
\r
79 public SoapException (string message, XmlQualifiedName code, string actor, Exception innerException)
\r
80 : base (message, innerException)
\r
86 public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail)
\r
91 this.detail = detail;
\r
94 public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail, Exception innerException)
\r
95 : base (message, innerException)
\r
99 this.detail = detail;
\r
103 public SoapException (string message, XmlQualifiedName code, SoapFaultSubcode subcode)
\r
107 this.subcode = subcode;
\r
110 public SoapException (string message, XmlQualifiedName code, string actor, string role, XmlNode detail, SoapFaultSubcode subcode, Exception innerException)
\r
111 : base (message, innerException)
\r
114 this.subcode = subcode;
\r
115 this.detail = detail;
\r
116 this.actor = actor;
\r
120 public SoapException (string message, XmlQualifiedName code, string actor, string role, string lang, XmlNode detail, SoapFaultSubcode subcode, Exception innerException)
\r
123 this.subcode = subcode;
\r
124 this.detail = detail;
\r
125 this.actor = actor;
\r
130 public static bool IsClientFaultCode (XmlQualifiedName code)
\r
132 if (code == ClientFaultCode) return true;
\r
133 if (code == Soap12FaultCodes.SenderFaultCode) return true;
\r
137 public static bool IsMustUnderstandFaultCode (XmlQualifiedName code)
\r
139 if (code == MustUnderstandFaultCode) return true;
\r
140 if (code == Soap12FaultCodes.MustUnderstandFaultCode) return true;
\r
144 public static bool IsServerFaultCode (XmlQualifiedName code)
\r
146 if (code == ServerFaultCode) return true;
\r
147 if (code == Soap12FaultCodes.ReceiverFaultCode) return true;
\r
151 public static bool IsVersionMismatchFaultCode (XmlQualifiedName code)
\r
153 if (code == VersionMismatchFaultCode) return true;
\r
154 if (code == Soap12FaultCodes.VersionMismatchFaultCode) return true;
\r
160 #endregion // Constructors
\r
164 public string Actor {
\r
165 get { return actor; }
\r
168 public XmlQualifiedName Code {
\r
169 get { return code; }
\r
172 public XmlNode Detail {
\r
173 get { return detail; }
\r
177 [System.Runtime.InteropServices.ComVisible(false)]
\r
178 public string Lang {
\r
179 get { return lang; }
\r
182 [System.Runtime.InteropServices.ComVisible(false)]
\r
183 public string Role {
\r
184 get { return role; }
\r
187 [System.Runtime.InteropServices.ComVisible(false)]
\r
188 public SoapFaultSubcode Subcode {
\r
189 get { return subcode; }
\r
192 // Same value as actor
\r
193 [System.Runtime.InteropServices.ComVisible(false)]
\r
194 public string Node {
\r
195 get { return actor; }
\r
198 #endregion // Properties
\r