[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-bugs
Subject: [Mono-bugs] [Bug 551671] New: Exception in
From: bugzilla_noreply () novell ! com
Date: 2009-10-31 19:07:40
Message-ID: bug-551671-28286 () http ! bugzilla ! novell ! com/
[Download RAW message or body]
http://bugzilla.novell.com/show_bug.cgi?id=551671
Summary: Exception in DataContractJsonSerializer when
deserializing JSON created by NETFX
DataContractJsonSerializer
Classification: Mono
Product: MonoTouch
Version: unspecified
Platform: Other
OS/Version: Mac OS X 10.6
Status: NEW
Severity: Blocker
Priority: P5 - None
Component: Class Libraries
AssignedTo: mono-bugs@lists.ximian.com
ReportedBy: christian.weyer@thinktecture.com
QAContact: mono-bugs@lists.ximian.com
Found By: ---
Description of Problem:
THe MonoTouch DataContractJsonSerializer fails with an exception when
deserializing a JSON string into an object - the JSON was created by
DataContractJsonSerializer from .NET Framework 3.5 SP1.
Steps to reproduce the problem:
1.
private TResult Deserialize<TResult> (string data) where TResult : class
{
Debug.WriteLine ("data: " + data);
var ser = new DataContractJsonSerializer (typeof(TResult));
TResult result;
using (var ms = new MemoryStream (Encoding.UTF8.GetBytes (data)))
{
result = ser.ReadObject (ms) as TResult;
}
return result;
}
2.
Actual Results:
Exception:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. --->
System.Runtime.Serialization.SerializationException: Deserialization has failed
---> System.InvalidOperationException: Node type Element is not supported in
this operation. (line 1, column 14)
at System.Xml.XmlReader.ReadContentString (Boolean isText) [0x00000]
at System.Xml.XmlReader.ReadContentString () [0x00000]
at System.Xml.XmlReader.ReadContentAsString () [0x00000]
at System.Xml.XmlDictionaryReader.ReadContentAsString (Int32
maxStringContentLength) [0x00000]
at System.Xml.XmlDictionaryReader.ReadContentAsString () [0x00000]
at System.Xml.XmlDictionaryReader.ReadElementContentAsString () [0x00000]
at
System.Runtime.Serialization.Json.JsonSerializationReader.ReadInstanceDrivenObject
() [0x00000]
at System.Runtime.Serialization.Json.JsonSerializationReader.ReadObject
(System.Type type) [0x00000]
at
System.Runtime.Serialization.Json.JsonSerializationReader.DeserializeGenericCollection
(System.Type collectionType, System.Type elementType) [0x00000]
at System.Runtime.Serialization.Json.JsonSerializationReader.ReadObject
(System.Type type) [0x00000]
at System.Runtime.Serialization.Json.JsonSerializationReader.ReadRoot ()
[0x00000]
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject
(System.Xml.XmlReader reader, Boolean verifyObjectName) [0x00000]
--- End of inner exception stack trace ---
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject
(System.Xml.XmlReader reader, Boolean verifyObjectName) [0x00000]
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject
(System.Xml.XmlDictionaryReader reader, Boolean verifyObjectName) [0x00000]
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject
(System.Xml.XmlDictionaryReader reader) [0x00000]
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject
(System.IO.Stream stream) [0x00000]
at iTecTeacher.MediaServiceClient.Deserialize[List`1] (System.String data)
[0x00000]
at iTecTeacher.MediaServiceClient.WebClient_DownloadStringCompleted
(System.Object sender, System.Net.DownloadStringCompletedEventArgs e) [0x00000]
at System.Net.WebClient.OnDownloadStringCompleted
(System.Net.DownloadStringCompletedEventArgs args) [0x00000]
at System.Net.WebClient.<DownloadStringAsync>m__D (System.Object state)
[0x00000]
Expected Results:
Should deserialize the JSON string to an object.
How often does this happen?
Always.
Additional Information:
--
Configure bugmail: http://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.
_______________________________________________
mono-bugs maillist - mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic