Reputation: 11
XmlDocument xmlDoc = new XmlDocument();xmlDoc.Load(responsedata);
It's give exception: System.UriFormatException: Invalid URI: The Uri string is too long.
Upvotes: 0
Views: 4695
Reputation: 103
I believe there is an assumption that responsedata holds a value pointing to an xml file to read in, i.e. "c:\temp\sometest.xml".
From your case, however, it appears that the responedata is a stream you received from a Web Service request. If this is the case, the try the following:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(responsedata);
HTH
Upvotes: 3
Reputation: 1027
Update your code to use the newer XDocument class, and call XDocument.Parse.
Upvotes: 1
Reputation: 759
xmlDoc.Load expects a URL not the file itsself. That's why it is telling that. It expects a normal URI but you hand it a big file...
http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.load.aspx
Upvotes: 4