Select to view content in your preferred language

[Bug] WMS layer crashes if the data is invalid

755
2
Jump to solution
02-20-2014 01:31 AM
Labels (1)
BjørnarSundsbø
Deactivated User
Hi,

I'm experiencing a bug with an unhandeled exception using WMS layer. The layer is pointing to an url that returns an invalid result. This causes an unhandled xml exception to occur, interrupting the loading of maps. This also means that the LayersInitialized is not raised. I fixed this in a previous version of the Toolkit.DataSources, and was hoping it would have been fixed in 10.2.

The Url I'm testing against is http://www.arcgis.com/sharing/content/items/c2c43e2a7269487785af7942533de9f9/data

The url returns a KMZ file, which is fine for the purpose of reproducing the error. I have noticed from time to time that our customers use a WMS service that sometimes returns invalid xml. Of course they should run against a WMS that always returns proper data, but that is outside of our control. Also, the site might be down, they have lost their internet connection through the proxy, or there could be other reasons why the returned data is not valid xml.

It would be great if you could fix this issue, so I don't have to build my own version of the toolkit whenever I upgrade 🙂

This is the exception I get.
Unhandeled exception System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.    at System.Xml.XmlTextReaderImpl.Throw(Exception e)    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)    at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()    at System.Xml.XmlTextReaderImpl.ParseDocumentContent()    at System.Xml.XmlTextReaderImpl.Read()    at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)    at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)    at System.Xml.Linq.XDocument.Parse(String text)    at ESRI.ArcGIS.Client.Toolkit.DataSources.WmsLayer.client_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)    at System.Net.WebClient.OnDownloadStringCompleted(DownloadStringCompletedEventArgs e)    at System.Net.WebClient.DownloadStringOperationCompleted(Object arg)    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
Good catch. Should be fixed with the next version (10.2.2).

Thanks for reporting that.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Good catch. Should be fixed with the next version (10.2.2).

Thanks for reporting that.
0 Kudos
BjørnarSundsbø
Deactivated User
Good catch. Should be fixed with the next version (10.2.2).

Thanks for reporting that.


I have another related issue where the Initialized event is never raised. Still in the situation with connectivity issues with the internet: Using WmtsLayer/ArcGisTiledLayer (haven't pinpointed which one) never seem to time out, or the timeout is very long. I was wondering if perhaps the layer should give up at some point.

Secondly, add a MaximumResolution/MinimumResolution to the OverviewMap so that we can control how far in/out we can show. Sometimes the overview map doesn't really give any overview in rural areas, and looses it's purpose. If Maximum is set, the red square can't shrink out of oblivion 🙂 Perhaps this should have been added to a different post, but I figured I should combine the requests.
0 Kudos