[Mono-bugs] [Bug 475803] New: Deserialization using a SoapFormatter fails and Throw an Exception.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Feb 13 13:13:23 EST 2009
https://bugzilla.novell.com/show_bug.cgi?id=475803
Summary: Deserialization using a SoapFormatter fails and Throw
an Exception.
Classification: Mono
Product: Mono: Class Libraries
Version: 2.0.x
Platform: All
OS/Version: Debian Potato
Status: NEW
Severity: Major
Priority: P5 - None
Component: System
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: solutionsntb at videotron.ca
QAContact: mono-bugs at lists.ximian.com
Found By: ---
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.0.6)
Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
In fact the problem is that Deserialization dosent stop after it has done
reading an object, so when the second object comes by it throw an exception
because it has two root xml elements.
Reproducible: Always
Steps to Reproduce:
wget http://kiss.my.ass.x-dating.nl/SoapBug.zip
unzip SoapBug.zip
cd ConsoleApplication1/ClassLibrary1/
gmcs -target:library -out:MySharedLib.dll MySharedLib.cs
Properties/AssemblyInfo.cs -r:System.Core -r:System.Xml.Linq
-r:System.Data.DataSetExtensions -r:System.Data -r:System.Xml
cd ../ConsoleApplication1
gmcs -out:MyApp.exe Program.cs Properties/AssemblyInfo.cs
-r:../ClassLibrary1/MySharedLib.dll -r:System.Core
-r:System.Runtime.Serialization.Formatters.Soap -r:System.Xml.Linq
-r:System.Data.DataSetExtensions -r:System.Data -r:System.Xml
MONO_PATH=../ConsoleApplication1/ClassLibrary1/:$MONO_PATH mono MyApp.exe
Actual Results:
Sent: MySharedLib.TestStruct
Sent: MySharedLib.TestStruct
System.Xml.XmlException: Multiple document element was detected. Line 7,
position 22.
at Mono.Xml2.XmlTextReader.ReadStartTag () [0x00000]
at Mono.Xml2.XmlTextReader.ReadContent () [0x00000]
at Mono.Xml2.XmlTextReader.Read () [0x00000]
at System.Xml.XmlTextReader.Read () [0x00000]
at System.Xml.XmlReader.ReadEndElement () [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapReader.Deserialize
(System.IO.Stream inStream, ISoapMessage soapMessage) [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000]
at MyApp.Program.Main (System.String[] args) [0x00000] : Multiple document
element was detected. Line 7, position 22.
Expected Results:
Sent: MySharedLib.TestStruct
Sent: MySharedLib.TestStruct
Got: MySharedLib.TestStruct
Got: MySharedLib.TestStruct
shockcore at armada:/tmp/ConsoleApplication1/ClassLibrary1$ gmcs -target:library
-out:MySharedLib.dll MySharedLib.cs Properties/AssemblyInfo.cs -r:System.Core
-r:System.Xml.Linq -r:System.Data.DataSetExtensions -r:System.Data
-r:System.Xml
shockcore at armada:/tmp/ConsoleApplication1/ClassLibrary1$ cd
./ConsoleApplication1
shockcore at armada:/tmp/ConsoleApplication1/ConsoleApplication1$ gmcs
-out:MyApp.exe Program.cs Properties/AssemblyInfo.cs
-r:../ClassLibrary1/MySharedLib.dll -r:System.Core
-r:System.Runtime.Serialization.Formatters.Soap -r:System.Xml.Linq
-r:System.Data.DataSetExtensions -r:System.Data -r:System.Xml
Program.cs(18,20): warning CS0219: The variable `c' is assigned but its value
is never used
Program.cs(42,15): warning CS0414: The private field `MyApp.Client.timer' is
assigned but its value is never used
Compilation succeeded - 2 warning(s)
shockcore at armada:/tmp/ConsoleApplication1/ConsoleApplication1$
MONO_PATH=../ClassLibrary1/:$MONO_PATH mono MyApp.exe
Sent: MySharedLib.TestStruct
Sent: MySharedLib.TestStruct
System.Xml.XmlException: Multiple document element was detected. Line 7,
position 22.
at Mono.Xml2.XmlTextReader.ReadStartTag () [0x00000]
at Mono.Xml2.XmlTextReader.ReadContent () [0x00000]
at Mono.Xml2.XmlTextReader.Read () [0x00000]
at System.Xml.XmlTextReader.Read () [0x00000]
at System.Xml.XmlReader.ReadEndElement () [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapReader.Deserialize
(System.IO.Stream inStream, ISoapMessage soapMessage) [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000]
at MyApp.Program.Main (System.String[] args) [0x00000] : Multiple document
element was detected. Line 7, position 22.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list