Bug 11088 - Deserializing xml with strange ASCII characters throws an exception
Summary: Deserializing xml with strange ASCII characters throws an exception
Status: RESOLVED DUPLICATE of bug 5827
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-12 18:40 UTC by Andy
Modified: 2013-03-12 18:54 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 5827

Description Andy 2013-03-12 18:40:17 UTC
I have confirmed this is still ocurring with the latest edition of monotouch.  there has been no activity on this bug since it was created last year.  I thought maybe because it referenced an eariler version of monotouch.  Therefore I create a new bug referencing the newer version.

+++ This bug was initially created as a clone of Bug #5827 +++

I have a WCF service which returns text from files. However some of the files that I deal with contain strange ASCII values and when they are deserialized on the client the deserializer throws an exception, which I've attached to the end of this description.

I ran a test and the ASCII characters that throw an exception are those with a decimal value from 0 to 8, 11, 12, and 14 to 31.

On a normal WCF client those characters do not throw an exception.

The following exception is for a string that only contains the ASCII character with a decimal value of 0.

System.Xml.XmlException: Referenced character was not allowed in XML. Normalization is True, checkCharacters = True  Line 1, position 170.
  at Mono.Xml2.XmlTextReader.ReadCharacterReference () [0x00165] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1775
  at Mono.Xml2.XmlTextReader.ReadReference (Boolean ignoreEntityReferences) [0x00015] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1728
  at Mono.Xml2.XmlTextReader.ReadText (Boolean notWhitespace) [0x00048] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1663
  at Mono.Xml2.XmlTextReader.ReadContent () [0x0015c] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1359
  at Mono.Xml2.XmlTextReader.Read () [0x00141] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader.cs:626
  at System.Xml.XmlTextReader.Read () [0x0006b] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlTextReader2.cs:564
  at System.Xml.XmlSimpleDictionaryReader.Read () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs:253
  at System.Xml.XmlReader.ReadStartElement () [0x0002f] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlReader.cs:724
  at System.Xml.XmlDictionaryReader.ReadElementContentAsString () [0x00018] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs:397
  at System.Runtime.Serialization.XmlFormatterDeserializer.DeserializePrimitive (System.Type type, System.Xml.XmlReader reader, System.Xml.XmlQualifiedName qname) [0x000c1] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:229
  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Type type, System.Xml.XmlReader reader) [0x0028e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:189
  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Xml.XmlReader reader, System.Type declaredType, System.Runtime.Serialization.KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, System.Runtime.Serialization.DataContractResolver resolver, System.Runtime.Serialization.DataContractResolver defaultResolver, System.String name, System.String ns, Boolean verifyObjectName) [0x0007e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:65
  at System.Runtime.Serialization.DataContractSerializer.ReadObject (System.Xml.XmlDictionaryReader reader, Boolean verifyObjectName) [0x00024] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:344
  at System.Runtime.Serialization.XmlObjectSerializer.ReadObject (System.Xml.XmlDictionaryReader reader) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:74
  at System.ServiceModel.Dispatcher.DataContractMessagesFormatter.ReadMessagePart (System.ServiceModel.Description.MessagePartDescription part, System.Xml.XmlDictionaryReader r) [0x00032] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:439
  at System.ServiceModel.Dispatcher.DataContractMessagesFormatter.MessageToParts (System.ServiceModel.Description.MessageDescription md, System.ServiceModel.Channels.Message message) [0x000ce] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:418
  at System.ServiceModel.Dispatcher.BaseMessagesFormatter.DeserializeReply (System.ServiceModel.Channels.Message message, System.Object[] parameters) [0x0004d] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:273
  at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply (System.ServiceModel.Channels.Message message, System.Object[] parameters) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:90
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x0024d] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:570
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00038] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:502
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x0001c] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:479
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-03-12 18:54:06 UTC
It's better to have only one bug report open for each bug, so I'm closing this as a duplicate for the other bug.

*** This bug has been marked as a duplicate of bug 5827 ***