DataContractJsonSerializer Serializes item, then cannot deserializ

  • Thread starter Thread starter Chad Scharf
  • Start date Start date
C

Chad Scharf

the JSON that is being emitted is being stored in a DB as an object state,
then fails to deserialize properly from that value. We've simplified it,
bypassing the database, encoding, etc and it still fails, however we are
serializing the exact same types in other areas of the application using the
same shared method and they all work just fine.

Here is the JSON that it is blowing up on:

"[{\"CLRTypeName\":\"DateTime\",\"Defaultvalue\":\"11\\\/22\\\/2008\",\"ParameterName\":\"StartDate\",\"ParameterType\":\"3\",\"ParameterValue\":\"\",\"Prompt\":\"Start
Date\",\"ValueList\":[]},{\"CLRTypeName\":\"DateTime\",\"Defaultvalue\":\"12\\\/22\\\/2008\",\"ParameterName\":\"EndDate\",\"ParameterType\":\"3\",\"ParameterValue\":\"\",\"Prompt\":\"End
Date\",\"ValueList\":[]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"LeaveReason\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"Leave
reason\",\"ValueList\":[\"-1|- ALL -\",\"10|ADOPT - Adoption\",\"1|BIRTH -
Birth of a Child\",\"14|BONEMARROW - Bone Marrow Donation\",\"8|ACTIVEDUTY -
Emergency Active Duty\",\"4|EMPHEALTH - Employee illness, injury, or health
condition\",\"18|ENLIST - Enlistment\",\"29|FMQE - Family Member Qualifying
Exigency\",\"23|SHCMIL - Family Military Member SHC\",\"3|FAMHEALTH - Family
Serious Health Condition\",\"11|FOSTER - Foster Placement\",\"13|ORGAN -
Organ Donation\",\"12|PREGMATERN - Pregnancy \\\/ Maternity\",\"19|RESERVE -
Reserve Duty\",\"15|SICKCHILD - Sick Child\",\"30|UNMGD -
Unmanaged\",\"21|WORK - Work Related Illness or
Injury\"]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"WorkType\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"WorkType\",\"ValueList\":[\"-1|-
ALL -\",\"1|Continuous Leave\",\"2|Intermittent Leave\",\"7|Medical
Only\",\"3|Reduced Schedule Leave\",\"0|No Lost
Time\"]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"Location\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"Location\",\"ValueList\":[\"-1|-
ALL -\",\"3|SPARTANBURG REGIONAL HEALTHCARE SYSTEM -
..\"]},{\"CLRTypeName\":\"bool\",\"Defaultvalue\":\"1\",\"ParameterName\":\"IncludeALL\",\"ParameterType\":\"5\",\"ParameterValue\":\"1\",\"Prompt\":\"Include
All
(internal)\",\"ValueList\":[]},{\"CLRTypeName\":\"string\",\"Defaultvalue\":\"WORK\",\"ParameterName\":\"OrgTypeCode\",\"ParameterType\":\"2\",\"ParameterValue\":\"WORK\",\"Prompt\":\"Org
Type Code
(internal)\",\"ValueList\":[]},{\"CLRTypeName\":\"Guid\",\"Defaultvalue\":\"\",\"ParameterName\":\"UserId\",\"ParameterType\":\"6\",\"ParameterValue\":\"\",\"Prompt\":\"Calling
UserID\",\"ValueList\":[]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"
\",\"ParameterName\":\"PersonID\",\"ParameterType\":\"1\",\"ParameterValue\":\"7\",\"Prompt\":\"Visibility
As\",\"ValueList\":[]},{\"CLRTypeName\":\"bool\",\"Defaultvalue\":\"\",\"ParameterName\":\"ShowPeers\",\"ParameterType\":\"5\",\"ParameterValue\":\"1\",\"Prompt\":\"Show Peers\",\"ValueList\":[]}]"

And then we tried a simple XmlObjectSerializer for the same type and
recieved the same error (here's the object Xml string that was generated and
failed):

"<ArrayOfReportParameter
xmlns=\"http:\/\/schemas.datacontract.org\/2004\/07\/iAM.Reporting.BLL.BusinessObjects\"
xmlns:i=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"><ReportParameter><CLRTypeName>DateTime<\/CLRTypeName><Defaultvalue>11\/22\/2008<\/Defaultvalue><ParameterName>StartDate<\/ParameterName><ParameterType>3<\/ParameterType><ParameterValue\/><Prompt>Start
Date<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>DateTime<\/CLRTypeName><Defaultvalue>12\/22\/2008<\/Defaultvalue><ParameterName>EndDate<\/ParameterName><ParameterType>3<\/ParameterType><ParameterValue\/><Prompt>End
Date<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>LeaveReason<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>Leave
reason<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>10|ADOPT - Adoption<\/a:string><a:string>1|BIRTH -
Birth of a Child<\/a:string><a:string>14|BONEMARROW - Bone Marrow
Donation<\/a:string><a:string>8|ACTIVEDUTY - Emergency Active
Duty<\/a:string><a:string>4|EMPHEALTH - Employee illness, injury, or health
condition<\/a:string><a:string>18|ENLIST -
Enlistment<\/a:string><a:string>29|FMQE - Family Member Qualifying
Exigency<\/a:string><a:string>23|SHCMIL - Family Military Member
SHC<\/a:string><a:string>3|FAMHEALTH - Family Serious Health
Condition<\/a:string><a:string>11|FOSTER - Foster
Placement<\/a:string><a:string>13|ORGAN - Organ
Donation<\/a:string><a:string>12|PREGMATERN - Pregnancy \/
Maternity<\/a:string><a:string>19|RESERVE - Reserve
Duty<\/a:string><a:string>15|SICKCHILD - Sick
Child<\/a:string><a:string>30|UNMGD - Unmanaged<\/a:string><a:string>21|WORK
- Work Related Illness or
Injury<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>WorkType<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>WorkType<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>1|Continuous
Leave<\/a:string><a:string>2|Intermittent
Leave<\/a:string><a:string>7|Medical Only<\/a:string><a:string>3|Reduced
Schedule Leave<\/a:string><a:string>0|No Lost
Time<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>Location<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>Location<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>3|SPARTANBURG REGIONAL HEALTHCARE SYSTEM -
..<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>bool<\/CLRTypeName><Defaultvalue>1<\/Defaultvalue><ParameterName>IncludeALL<\/ParameterName><ParameterType>5<\/ParameterType><ParameterValue>1<\/ParameterValue><Prompt>Include
All (internal)<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>string<\/CLRTypeName><Defaultvalue>WORK<\/Defaultvalue><ParameterName>OrgTypeCode<\/ParameterName><ParameterType>2<\/ParameterType><ParameterValue>WORK<\/ParameterValue><Prompt>Org
Type Code (internal)<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Guid<\/CLRTypeName><Defaultvalue\/><ParameterName>UserId<\/ParameterName><ParameterType>6<\/ParameterType><ParameterValue\/><Prompt>Calling
UserID<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>
<\/Defaultvalue><ParameterName>PersonID<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>7<\/ParameterValue><Prompt>Visibility
As<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>bool<\/CLRTypeName><Defaultvalue\/><ParameterName>ShowPeers<\/ParameterName><ParameterType>5<\/ParameterType><ParameterValue>1<\/ParameterValue><Prompt>Show
Peers<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><\/ArrayOfReportParameter>"


Finally, here is the error and stack trace we're getting back form the
deserializer:

2008-12-22 17:47:07,851 [3] ERROR
iAM.Reporting.BLL.BusinessObjects.ReportSubscription [(null)] -
ReportParameters::Get() Exception:
System.Runtime.Serialization.SerializationException: There was an error
deserializing the object of type
System.Collections.Generic.List`1[[iAM.Reporting.BLL.BusinessObjects.ReportParameter,
iAM.Reporting.BLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].
The token '"' was expected but found '\'. Line 1, position 31. --->
System.Xml.XmlException: The token '"' was expected but found '\'. Line 1,
position 31.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader
reader, String res, String arg1, String arg2, String arg3)
at System.Xml.XmlExceptionHelper.ThrowTokenExpected(XmlDictionaryReader
reader, String expected, Char found)
at System.Xml.XmlUTF8TextReader.ReadAttributes()
at System.Xml.XmlUTF8TextReader.ReadStartElement()
at System.Xml.XmlUTF8TextReader.Read()
at System.Xml.XmlBaseReader.IsStartElement()
at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName,
XmlDictionaryString namespaceUri)
at
System.Runtime.Serialization.XmlReaderDelegator.IsStartElement(XmlDictionaryString localname, XmlDictionaryString ns)
at
System.Runtime.Serialization.XmlObjectSerializer.IsRootElement(XmlReaderDelegator
reader, DataContract contract, XmlDictionaryString name, XmlDictionaryString
ns)
at
System.Runtime.Serialization.DataContractSerializer.InternalIsStartObject(XmlReaderDelegator reader)
at
System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
--- End of inner exception stack trace ---
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(Stream
stream)
at iAM.Core.Common.SerializationObject.DeserializeObject(String
objectAsSerializedString, XmlObjectSerializer serializer)
at iAM.Core.Common.SerializationObject.DeserializeObject(String
objectAsSerializedString, Type objectType)
at
iAM.Reporting.BLL.BusinessObjects.ReportSubscription.get_ReportParameters()
in C:\VSTS_SRC\Source
Code\iAM.Reporting\iAM.Reporting.BLL\BusinessObjects\ReportSubscription.cs:line 121


Any help would be greatly appreciated.

Thanks,
 
OK, nevermind. Got this figured out. Turns out our DAL was re-serializing the
serialized JSON string going in, however was only attemptnig to deserialize
it once coming out, which caused the incorrect character (escape) to fail
because the first deserialization should have been to System.String.
--
Chad Scharf
_______________________________
http://www.chadscharf.com


Chad Scharf said:
the JSON that is being emitted is being stored in a DB as an object state,
then fails to deserialize properly from that value. We've simplified it,
bypassing the database, encoding, etc and it still fails, however we are
serializing the exact same types in other areas of the application using the
same shared method and they all work just fine.

Here is the JSON that it is blowing up on:

"[{\"CLRTypeName\":\"DateTime\",\"Defaultvalue\":\"11\\\/22\\\/2008\",\"ParameterName\":\"StartDate\",\"ParameterType\":\"3\",\"ParameterValue\":\"\",\"Prompt\":\"Start
Date\",\"ValueList\":[]},{\"CLRTypeName\":\"DateTime\",\"Defaultvalue\":\"12\\\/22\\\/2008\",\"ParameterName\":\"EndDate\",\"ParameterType\":\"3\",\"ParameterValue\":\"\",\"Prompt\":\"End
Date\",\"ValueList\":[]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"LeaveReason\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"Leave
reason\",\"ValueList\":[\"-1|- ALL -\",\"10|ADOPT - Adoption\",\"1|BIRTH -
Birth of a Child\",\"14|BONEMARROW - Bone Marrow Donation\",\"8|ACTIVEDUTY -
Emergency Active Duty\",\"4|EMPHEALTH - Employee illness, injury, or health
condition\",\"18|ENLIST - Enlistment\",\"29|FMQE - Family Member Qualifying
Exigency\",\"23|SHCMIL - Family Military Member SHC\",\"3|FAMHEALTH - Family
Serious Health Condition\",\"11|FOSTER - Foster Placement\",\"13|ORGAN -
Organ Donation\",\"12|PREGMATERN - Pregnancy \\\/ Maternity\",\"19|RESERVE -
Reserve Duty\",\"15|SICKCHILD - Sick Child\",\"30|UNMGD -
Unmanaged\",\"21|WORK - Work Related Illness or
Injury\"]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"WorkType\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"WorkType\",\"ValueList\":[\"-1|-
ALL -\",\"1|Continuous Leave\",\"2|Intermittent Leave\",\"7|Medical
Only\",\"3|Reduced Schedule Leave\",\"0|No Lost
Time\"]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"-1\",\"ParameterName\":\"Location\",\"ParameterType\":\"1\",\"ParameterValue\":\"-1\",\"Prompt\":\"Location\",\"ValueList\":[\"-1|-
ALL -\",\"3|SPARTANBURG REGIONAL HEALTHCARE SYSTEM -
.\"]},{\"CLRTypeName\":\"bool\",\"Defaultvalue\":\"1\",\"ParameterName\":\"IncludeALL\",\"ParameterType\":\"5\",\"ParameterValue\":\"1\",\"Prompt\":\"Include
All
(internal)\",\"ValueList\":[]},{\"CLRTypeName\":\"string\",\"Defaultvalue\":\"WORK\",\"ParameterName\":\"OrgTypeCode\",\"ParameterType\":\"2\",\"ParameterValue\":\"WORK\",\"Prompt\":\"Org
Type Code
(internal)\",\"ValueList\":[]},{\"CLRTypeName\":\"Guid\",\"Defaultvalue\":\"\",\"ParameterName\":\"UserId\",\"ParameterType\":\"6\",\"ParameterValue\":\"\",\"Prompt\":\"Calling
UserID\",\"ValueList\":[]},{\"CLRTypeName\":\"Int32\",\"Defaultvalue\":\"
\",\"ParameterName\":\"PersonID\",\"ParameterType\":\"1\",\"ParameterValue\":\"7\",\"Prompt\":\"Visibility
As\",\"ValueList\":[]},{\"CLRTypeName\":\"bool\",\"Defaultvalue\":\"\",\"ParameterName\":\"ShowPeers\",\"ParameterType\":\"5\",\"ParameterValue\":\"1\",\"Prompt\":\"Show Peers\",\"ValueList\":[]}]"

And then we tried a simple XmlObjectSerializer for the same type and
recieved the same error (here's the object Xml string that was generated and
failed):

"<ArrayOfReportParameter
xmlns=\"http:\/\/schemas.datacontract.org\/2004\/07\/iAM.Reporting.BLL.BusinessObjects\"
xmlns:i=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"><ReportParameter><CLRTypeName>DateTime<\/CLRTypeName><Defaultvalue>11\/22\/2008<\/Defaultvalue><ParameterName>StartDate<\/ParameterName><ParameterType>3<\/ParameterType><ParameterValue\/><Prompt>Start
Date<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>DateTime<\/CLRTypeName><Defaultvalue>12\/22\/2008<\/Defaultvalue><ParameterName>EndDate<\/ParameterName><ParameterType>3<\/ParameterType><ParameterValue\/><Prompt>End
Date<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>LeaveReason<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>Leave
reason<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>10|ADOPT - Adoption<\/a:string><a:string>1|BIRTH -
Birth of a Child<\/a:string><a:string>14|BONEMARROW - Bone Marrow
Donation<\/a:string><a:string>8|ACTIVEDUTY - Emergency Active
Duty<\/a:string><a:string>4|EMPHEALTH - Employee illness, injury, or health
condition<\/a:string><a:string>18|ENLIST -
Enlistment<\/a:string><a:string>29|FMQE - Family Member Qualifying
Exigency<\/a:string><a:string>23|SHCMIL - Family Military Member
SHC<\/a:string><a:string>3|FAMHEALTH - Family Serious Health
Condition<\/a:string><a:string>11|FOSTER - Foster
Placement<\/a:string><a:string>13|ORGAN - Organ
Donation<\/a:string><a:string>12|PREGMATERN - Pregnancy \/
Maternity<\/a:string><a:string>19|RESERVE - Reserve
Duty<\/a:string><a:string>15|SICKCHILD - Sick
Child<\/a:string><a:string>30|UNMGD - Unmanaged<\/a:string><a:string>21|WORK
- Work Related Illness or
Injury<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>WorkType<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>WorkType<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>1|Continuous
Leave<\/a:string><a:string>2|Intermittent
Leave<\/a:string><a:string>7|Medical Only<\/a:string><a:string>3|Reduced
Schedule Leave<\/a:string><a:string>0|No Lost
Time<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>-1<\/Defaultvalue><ParameterName>Location<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>-1<\/ParameterValue><Prompt>Location<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"><a:string>-1|-
ALL -<\/a:string><a:string>3|SPARTANBURG REGIONAL HEALTHCARE SYSTEM -
.<\/a:string><\/ValueList><\/ReportParameter><ReportParameter><CLRTypeName>bool<\/CLRTypeName><Defaultvalue>1<\/Defaultvalue><ParameterName>IncludeALL<\/ParameterName><ParameterType>5<\/ParameterType><ParameterValue>1<\/ParameterValue><Prompt>Include
All (internal)<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>string<\/CLRTypeName><Defaultvalue>WORK<\/Defaultvalue><ParameterName>OrgTypeCode<\/ParameterName><ParameterType>2<\/ParameterType><ParameterValue>WORK<\/ParameterValue><Prompt>Org
Type Code (internal)<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Guid<\/CLRTypeName><Defaultvalue\/><ParameterName>UserId<\/ParameterName><ParameterType>6<\/ParameterType><ParameterValue\/><Prompt>Calling
UserID<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>Int32<\/CLRTypeName><Defaultvalue>
<\/Defaultvalue><ParameterName>PersonID<\/ParameterName><ParameterType>1<\/ParameterType><ParameterValue>7<\/ParameterValue><Prompt>Visibility
As<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><ReportParameter><CLRTypeName>bool<\/CLRTypeName><Defaultvalue\/><ParameterName>ShowPeers<\/ParameterName><ParameterType>5<\/ParameterType><ParameterValue>1<\/ParameterValue><Prompt>Show
Peers<\/Prompt><ValueList
xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"\/><\/ReportParameter><\/ArrayOfReportParameter>"


Finally, here is the error and stack trace we're getting back form the
deserializer:

2008-12-22 17:47:07,851 [3] ERROR
iAM.Reporting.BLL.BusinessObjects.ReportSubscription [(null)] -
ReportParameters::Get() Exception:
System.Runtime.Serialization.SerializationException: There was an error
deserializing the object of type
System.Collections.Generic.List`1[[iAM.Reporting.BLL.BusinessObjects.ReportParameter,
iAM.Reporting.BLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].
The token '"' was expected but found '\'. Line 1, position 31. --->
System.Xml.XmlException: The token '"' was expected but found '\'. Line 1,
position 31.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader
reader, String res, String arg1, String arg2, String arg3)
at System.Xml.XmlExceptionHelper.ThrowTokenExpected(XmlDictionaryReader
reader, String expected, Char found)
at System.Xml.XmlUTF8TextReader.ReadAttributes()
at System.Xml.XmlUTF8TextReader.ReadStartElement()
at System.Xml.XmlUTF8TextReader.Read()
at System.Xml.XmlBaseReader.IsStartElement()
at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName,
XmlDictionaryString namespaceUri)
at
System.Runtime.Serialization.XmlReaderDelegator.IsStartElement(XmlDictionaryString localname, XmlDictionaryString ns)
at
System.Runtime.Serialization.XmlObjectSerializer.IsRootElement(XmlReaderDelegator
reader, DataContract contract, XmlDictionaryString name, XmlDictionaryString
ns)
at
System.Runtime.Serialization.DataContractSerializer.InternalIsStartObject(XmlReaderDelegator reader)
at
System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
--- End of inner exception stack trace ---
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at
System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(Stream
stream)
at iAM.Core.Common.SerializationObject.DeserializeObject(String
objectAsSerializedString, XmlObjectSerializer serializer)
at iAM.Core.Common.SerializationObject.DeserializeObject(String
objectAsSerializedString, Type objectType)
at
iAM.Reporting.BLL.BusinessObjects.ReportSubscription.get_ReportParameters()
in C:\VSTS_SRC\Source
Code\iAM.Reporting\iAM.Reporting.BLL\BusinessObjects\ReportSubscription.cs:line 121


Any help would be greatly appreciated.

Thanks,
 
Back
Top