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
\r
13 // a copy of this software and associated documentation files (the
\r
14 // "Software"), to deal in the Software without restriction, including
\r
15 // without limitation the rights to use, copy, modify, merge, publish,
\r
16 // distribute, sublicense, and/or sell copies of the Software, and to
\r
17 // permit persons to whom the Software is furnished to do so, subject to
\r
18 // the following conditions:
\r
20 // The above copyright notice and this permission notice shall be
\r
21 // included in all copies or substantial portions of the Software.
\r
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
34 namespace System.Web.Services.Protocols
\r
39 public class SoapException : SystemException
\r
43 public static readonly XmlQualifiedName ClientFaultCode = new XmlQualifiedName ("Client", "http://schemas.xmlsoap.org/soap/envelope/");
\r
44 public static readonly XmlQualifiedName DetailElementName = new XmlQualifiedName ("detail");
\r
45 public static readonly XmlQualifiedName MustUnderstandFaultCode = new XmlQualifiedName ("MustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");
\r
46 public static readonly XmlQualifiedName ServerFaultCode = new XmlQualifiedName ("Server", "http://schemas.xmlsoap.org/soap/envelope/");
\r
47 public static readonly XmlQualifiedName VersionMismatchFaultCode = new XmlQualifiedName ("VersionMismatch", "http://schemas.xmlsoap.org/soap/envelope/");
\r
50 XmlQualifiedName code;
\r
56 SoapFaultSubcode subcode;
\r
60 #region Constructors
\r
62 public SoapException (string message, XmlQualifiedName code)
\r
68 public SoapException (string message, XmlQualifiedName code, Exception innerException)
\r
69 : base (message, innerException)
\r
74 public SoapException (string message, XmlQualifiedName code, string actor)
\r
81 public SoapException (string message, XmlQualifiedName code, string actor, Exception innerException)
\r
82 : base (message, innerException)
\r
88 public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail)
\r
93 this.detail = detail;
\r
96 public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail, Exception innerException)
\r
97 : base (message, innerException)
\r
100 this.actor = actor;
\r
101 this.detail = detail;
\r
105 public SoapException (string message, XmlQualifiedName code, SoapFaultSubcode subcode)
\r
109 this.subcode = subcode;
\r
112 public SoapException (string message, XmlQualifiedName code, string actor, string role, XmlNode detail, SoapFaultSubcode subcode, Exception innerException)
\r
113 : base (message, innerException)
\r
116 this.subcode = subcode;
\r
117 this.detail = detail;
\r
118 this.actor = actor;
\r
122 public SoapException (string message, XmlQualifiedName code, string actor, string role, string lang, XmlNode detail, SoapFaultSubcode subcode, Exception innerException)
\r
125 this.subcode = subcode;
\r
126 this.detail = detail;
\r
127 this.actor = actor;
\r
132 public static bool IsClientFaultCode (XmlQualifiedName code)
\r
134 if (code == ClientFaultCode) return true;
\r
135 if (code == Soap12FaultCodes.SenderFaultCode) return true;
\r
139 public static bool IsMustUnderstandFaultCode (XmlQualifiedName code)
\r
141 if (code == MustUnderstandFaultCode) return true;
\r
142 if (code == Soap12FaultCodes.MustUnderstandFaultCode) return true;
\r
146 public static bool IsServerFaultCode (XmlQualifiedName code)
\r
148 if (code == ServerFaultCode) return true;
\r
149 if (code == Soap12FaultCodes.ReceiverFaultCode) return true;
\r
153 public static bool IsVersionMismatchFaultCode (XmlQualifiedName code)
\r
155 if (code == VersionMismatchFaultCode) return true;
\r
156 if (code == Soap12FaultCodes.VersionMismatchFaultCode) return true;
\r
162 #endregion // Constructors
\r
166 public string Actor {
\r
167 get { return actor; }
\r
170 public XmlQualifiedName Code {
\r
171 get { return code; }
\r
174 public XmlNode Detail {
\r
175 get { return detail; }
\r
179 [System.Runtime.InteropServices.ComVisible(false)]
\r
180 public string Lang {
\r
181 get { return lang; }
\r
184 [System.Runtime.InteropServices.ComVisible(false)]
\r
185 public string Role {
\r
186 get { return role; }
\r
189 [System.Runtime.InteropServices.ComVisible(false)]
\r
190 public SoapFaultSubcode SubCode {
\r
191 get { return subcode; }
\r
194 // Same value as actor
\r
195 [System.Runtime.InteropServices.ComVisible(false)]
\r
196 public string Node {
\r
197 get { return actor; }
\r
200 #endregion // Properties
\r