blue9manish / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

.NET GData XML parsing problem when querying contacts #678

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When calling the Google.GData.Client.Service.Query function for a certain user, 
the code throws an exception when trying to parse the response XML. This 
happens for very few users, but it happens often to be noticed. 

The main message of the exception is "Parsing failed", the inner message of the 
exception could come in the following forms:
'default2' is an undeclared prefix
'ns0' is an undeclared prefix
'atom' is an undeclared prefix
'gs' is an undeclared prefix

Tracing the problem in Google's GData code, I see that the problem occurs in 
the function "protected void OnNewExtensionElement(XmlReader reader, AtomBase 
baseObject)", found under the namespace "Google.GData.Client" in the file 
basefeedparser.cs. The exception occurs at the following code line 
"this.Document.ReadNode(reader)".

The .NET System XMLReader fails to read that node in the XML response because 
the prefixes default2, ns0, atom, gs are supposed to be namespaces, but it 
seems that these namespaces were never defined in the XML response returned by 
Google.

Could you please look into this issue?

Thanks!  

Original issue reported on code.google.com by a...@insight.ly on 2 Jan 2014 at 10:58

GoogleCodeExporter commented 8 years ago
The same problem occurs. Stack trace (maybe will be helpful):

Inner: System.Xml.XmlException: 'default' est un préfixe non déclaré. Ligne 
483, position 8.
   à System.Xml.XmlTextReaderImpl.Throw(Exception e)
   à System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   à System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   à System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   à System.Xml.XmlTextReaderImpl.ParseAttributes()
   à System.Xml.XmlTextReaderImpl.ParseElement()
   à System.Xml.XmlTextReaderImpl.ParseElementContent()
   à System.Xml.XmlTextReaderImpl.Read()
   à System.Xml.XmlTextReader.Read()
   à System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   à System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader reader)
   à System.Xml.XmlDocument.ReadNode(XmlReader reader)
   à Google.GData.Client.BaseFeedParser.OnNewExtensionElement(XmlReader reader, AtomBase baseObject)
   à Google.GData.Client.AtomFeedParser.ParseExtensionElements(XmlReader reader, AtomBase baseObject)
   à Google.GData.Client.AtomFeedParser.ParseEntry(XmlReader reader)
   à Google.GData.Client.AtomFeedParser.ParseSource(XmlReader reader, AtomSource source)
   à Google.GData.Client.AtomFeedParser.ParseFeed(XmlReader reader, AtomFeed feed)
   à Google.GData.Client.AtomFeedParser.Parse(Stream streamInput, AtomFeed feed)

Original comment by Dmitr...@gmail.com on 9 Dec 2014 at 3:36