Bug 6263 - "There is an error in XML document" exception on the Microsoft Web Service response
Summary: "There is an error in XML document" exception on the Microsoft Web Service re...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-07-24 16:12 UTC by Ben
Modified: 2013-12-05 18:34 UTC (History)
4 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 NORESPONSE

Description Ben 2012-07-24 16:12:08 UTC
Monotouch 5.3.5.
I am calling a Sharepoint standard search web service which returns XML. XML response is parsed correctly by MS class libraries. Web service proxy was generated by MonoDevelop.

The exception:

Exception occured, message: There is an error in XML document.
Exception:
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHelper.ReadSoapMessage (System.Xml.XmlTextReader xmlReader, System.Xml.Serialization.XmlSerializer bodySerializer, System.Xml.Serialization.XmlSerializer headerSerializer, Boolean soap12, System.Object& body, System.Web.Services.Protocols.SoapHeaderCollection& headers) [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHelper.ReadSoapMessage (System.Xml.XmlTextReader xmlReader, System.Web.Services.Protocols.SoapMethodStubInfo method, SoapHeaderDirection dir, Boolean soap12, System.Object& body, System.Web.Services.Protocols.SoapHeaderCollection& headers) [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse (System.Net.WebResponse response, System.Web.Services.Protocols.SoapClientMessage message, System.Web.Services.Protocols.SoapExtension[] extensions) [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) 

The XML that server responds with:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><QueryExResponse xmlns="http://microsoft.com/webservices/OfficeServer/QueryService"><QueryExResult><xs:schema id="Results" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"><xs:element name="Results" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:QueryTerms="Ha;" msprop:IgnoredNoiseWords="" msprop:Keyword="" msprop:QueryModification="" msprop:ElapsedTime="49" msprop:Definition="" msprop:SpellingSuggestion=""><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element name="RelevantResults" msprop:TotalRows="2" msprop:IsTotalRowsExact="True"><xs:complexType><xs:sequence><xs:element name="Path" type="xs:string" minOccurs="0" /><xs:element name="AccountName" type="xs:string" minOccurs="0" /><xs:element name="PreferredName" type="xs:string" minOccurs="0" /><xs:element name="FirstName" type="xs:string" minOccurs="0" /><xs:element name="LastName" type="xs:string" minOccurs="0" /><xs:element name="JobTitle" type="xs:string" minOccurs="0" /><xs:element name="PictureURL" type="xs:string" minOccurs="0" /><xs:element name="Department" type="xs:string" minOccurs="0" /><xs:element name="WorkEmail" type="xs:string" minOccurs="0" /><xs:element name="MobilePhone" type="xs:string" minOccurs="0" /><xs:element name="AboutMe" type="xs:string" minOccurs="0" /><xs:element name="BaseOfficeLocation" type="xs:string" minOccurs="0" /><xs:element name="WorkPhone" type="xs:string" minOccurs="0" /><xs:element name="Schools" msdata:DataType="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:anyType" minOccurs="0" /><xs:element name="Skills" msdata:DataType="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:anyType" minOccurs="0" /><xs:element name="PastProjects" msdata:DataType="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:anyType" minOccurs="0" /><xs:element name="Interests" msdata:DataType="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:anyType" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><Results xmlns=""><RelevantResults diffgr:id="RelevantResults1" msdata:rowOrder="0"><Path>http://demosp-people.evepoints.com/Person.aspx?accountname=win2008\hagrirub</Path><AccountName>win2008\hagrirub</AccountName><PreferredName>Rubeus Hagrid</PreferredName><FirstName>Rubeus</FirstName><LastName>Hagrid</LastName><JobTitle>Keeper of Keys</JobTitle><PictureURL>http://demosp-people.evepoints.com/User Photos/Profile Pictures/win2008_hagrirub_MThumb.jpg</PictureURL><Department>Care of Magical Creatures</Department><WorkEmail>Rubeus.Hagrid@hogwarts.com</WorkEmail><MobilePhone>111 465 7095</MobilePhone><AboutMe>The Half-giant gamekeeper, Keeper of Keys and Grounds, and, from Harry's third year at Hogwarts, the Care of Magical Creatures professor. He has a habit of introducing dangerous creatures, which he considers harmless, to the students.</AboutMe><WorkPhone>111 444 7134</WorkPhone></RelevantResults><RelevantResults diffgr:id="RelevantResults2" msdata:rowOrder="1"><Path>http://demosp-people.evepoints.com/Person.aspx?accountname=win2008\pottehar</Path><AccountName>win2008\pottehar</AccountName><PreferredName>Harry Potter</PreferredName><FirstName>Harry</FirstName><LastName>Potter</LastName><JobTitle>Half-blood Wizard</JobTitle><PictureURL>http://demosp-people.evepoints.com/User Photos/Profile Pictures/win2008_pottehar_MThumb.jpg</PictureURL><WorkEmail>Harry.Potter@hogwarts.com</WorkEmail><MobilePhone>111 465 1809</MobilePhone><AboutMe>Harry James Potter (b. 31 July 1980) was a half-blood wizard, the only child and son of James Potter and Lily Potter (n?e Evans), and one of the most famous wizards of modern times. In an attempt to circumvent a prophecy that a boy born at the end of July 1980 would be able to defeat him, Voldemort tried to murder him when he was a toddler after murdering Harry's parents as they tried to protect him. This early attempt to vanquish Harry led to Voldemort's first defeat and the end of the First Wi</AboutMe><WorkPhone>111 444 1813</WorkPhone><Skills><string>Love</string><string>Defence Against the Dark Arts</string><string>Duelling</string><string>Flying</string><string>Parselmouth</string><string>Potioneer</string><string>Transfiguration</string><string>Charms</string><string>Apparition</string><string>Herbologist</string><string>Leadership</string></Skills></RelevantResults></Results></diffgr:diffgram></QueryExResult></QueryExResponse></soap:Body></soap:Envelope>
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-10-18 08:48:24 UTC
The xml itself is valid, so it's impossible to say what went wrong without knowing how it was deserialized (there is more information involved, regarding the target deserialization type).

This means that we'll need a complete test case in order to track it down.
Comment 2 René Ruppert 2013-05-10 17:45:44 UTC
This sounds a lot like what I'm facing here: http://forums.xamarin.com/discussion/4031/exception-in-serialization-xmlserializer-i-can-reproduce-it-in-a-mono-console-app-how-to-debug#latest

and have already reported here:

https://bugzilla.xamarin.com/show_bug.cgi?id=5904

(see the part in my comment from 2012-11-21 10:54:28 EST around the middle of the exception I pasted there:

  --- End of inner exception stack trace ---   at
System.Xml.Serialization.XmlSerializer.Deserialize
(System.Xml.Serialization.XmlSerializationReader reader) [0x00064] in
/Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:371
   at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReade

)

Please investigate this soon! I cannot download files anymore from my machine.

One interesting note: this ONLY happens if the previous action of the web service call returned a server fault exception!
Comment 3 Ben 2013-05-10 20:56:21 UTC
Rolf,
The question was what is the target type. The answer is - DataSet.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2013-05-13 05:25:54 UTC
Ben, I'd still need a complete test case in order to reproduce it.
Comment 5 PJ 2013-11-19 17:04:31 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 6 PJ 2013-12-05 18:34:37 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.