Fix .Net Soap serialization compatibility.
authorBoris Kirzner <borisk@mono-cvs.ximian.com>
Mon, 3 Apr 2006 10:30:43 +0000 (10:30 -0000)
committerBoris Kirzner <borisk@mono-cvs.ximian.com>
Mon, 3 Apr 2006 10:30:43 +0000 (10:30 -0000)
svn path=/trunk/mcs/; revision=58928

mcs/class/System.XML/System.Xml/ChangeLog
mcs/class/System.XML/System.Xml/XmlException.cs

index 3983f3f29c078f84b2f9796f8d4cbb1c79dac98d..be6155f898970fd91866470c171fa68d3aeb5bc5 100644 (file)
@@ -1,3 +1,6 @@
+2006-04-03     Boris Kirzner <borisk@mainsoft.com>
+       * XmlException.cs: fix .net soap serialization compatibility.
+
 2006-03-28  Atsushi Enomoto <atsushi@ximian.com>
 
        * XmlNameEntry.cs XmlNameEntryCache.cs :
index 84f997596312aaa8e7361fdd597bbd05358417d2..c1896a51edca656c4f8f41412a8f662d54635da9 100644 (file)
@@ -42,6 +42,15 @@ namespace System.Xml
                int lineNumber;
                int linePosition;
                string sourceUri;
+               string res;
+               string [] messages;
+
+               #endregion
+
+               #region consts
+
+               private const string Xml_DefaultException = "Xml_DefaultException";
+               private  const string Xml_UserException = "Xml_UserException";
 
                #endregion
 
@@ -50,11 +59,15 @@ namespace System.Xml
                public XmlException () 
                        : base ()
                {
+                       this.res = Xml_DefaultException;
+                       this.messages = new string [1];
                }
 
                public XmlException (string message, Exception innerException) 
                        : base (message, innerException)
                {
+                       this.res = Xml_UserException;
+                       this.messages = new string [] {message};
                }
 
                protected XmlException (SerializationInfo info, StreamingContext context)
@@ -62,12 +75,18 @@ namespace System.Xml
                {
                        this.lineNumber = info.GetInt32 ("lineNumber");
                        this.linePosition = info.GetInt32 ("linePosition");
+                       this.res = info.GetString ("res");
+                       this.messages = (string []) info.GetValue ("args", typeof(string []));
+#if NET_2_0
                        this.sourceUri = info.GetString ("sourceUri");
+#endif
                }
 
                public XmlException (string message)
                        : base (message)
                {
+                       this.res = Xml_UserException;
+                       this.messages = new string [] {message};
                }
 
                internal XmlException (IXmlLineInfo li,
@@ -81,7 +100,7 @@ namespace System.Xml
                        Exception innerException,
                        string sourceUri,
                        string message)
-                       : base (message, innerException)
+                       : this (message, innerException)
                {
                        if (li != null) {
                                this.lineNumber = li.LineNumber;
@@ -91,7 +110,7 @@ namespace System.Xml
                }
 
                public XmlException (string message, Exception innerException, int lineNumber, int linePosition)
-                       : base (message, innerException)
+                       : this (message, innerException)
                {
                        this.lineNumber = lineNumber;
                        this.linePosition = linePosition;
@@ -135,7 +154,11 @@ namespace System.Xml
                        base.GetObjectData (info, context);
                        info.AddValue ("lineNumber", lineNumber);
                        info.AddValue ("linePosition", linePosition);
+                       info.AddValue ("res", res);
+                       info.AddValue ("args", messages);
+#if NET_2_0
                        info.AddValue ("sourceUri", sourceUri);
+#endif
                }
 
                #endregion