I have written my own MapTileSource class that enables the xamMap to use a WMS. This works excellent and gives us access to all map sources we need.
However, now and then the WMS may fail on a single request for a tile and return an empty response. When this happens I receive the following exception:
System.AccessViolationException was unhandled Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. InnerException:
The result of the exception is that my Silverlight application crashes and terminates.
Since no stack trace or other information is available I am at a loss how to proceed. From what I have managed to figure out it seems that the xamMap control fails when the response for a tile request is empty. My GetTileLayers method fills the tileImageLayerSources list with the appropriate urls, but have no means of validating the request before it is performed. The urls are well formed, but as said the WMS sometimes fails on a single request.
Do yoy have any suggestions on how to handle this problem? If I somehow could trap the exception, hence avoiding the application crash, everything would be fine.
Hi Mikael,
After the GetTileLayers method fills your list of urls, are you then making the WMS requests manually then waiting for the response? Are you able to view the response after making the request and checking it to make sure it's valid?
I see that the InnerException portion of the error is missing in your post. Does the InnerException have any additional information?
I have spent the day working on this problem, and have some new information. I have intercepted all requests and responses with the WMS server, as well as set up my own test site to return various reponses to test the behaviour of the xamMap.
I was wrong in that the WMS returns an empty response; it returns an error message as xml markup, like this one:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?><ServiceExceptionReport version="1.1.0"><ServiceException>[99][Interceptor]Overforbruk p� kort tid.Vent litt, pr�v igjen.(5)</ServiceException></ServiceExceptionReport>
This is not an error in the request, since trying it again in a few seconds return a valid tile. The error response from the WMS states that it is temporarily out of resources, and "please try again in a while".
However the end result stays the same; when this response arrives then the xamMap gets into trouble handling it. Since all this happens asynchrounously I have no place to attach an error handler (that I know of). Is it possible to attach an event handler of some sort to the xamMap in order to trap and handle this kind of errors?
Change of plans, so I found the time today to assemble a small test project. The sample application uses www2.demis.nl (a free sample wms) to draw a map of the world. The MapTileSource class included triggers an invalid wms request for every 20th map tile. Also every wms request and response are written to the Immediate window. When the initial map is completed just start zooming and you will see the error triggered.
As you can see when the wms returns a response not being a valid image then the whole application shuts down. I acknowledge that the map expects valid image tiles as responses, but it would be nice if it could have some sort of basic validation or error trapping, allowing the application to continue even when a tile fails from time to time.
I have zipped the wms test project resulting in a zip file of size 2MB. I am not allowed to upload this file due to its size, so if you please can provide an email address or other means to deliver the file.
Regards, Mikael
The large file size may be from the bin and obj folders being included in the zip file. Deleting these folders should bring the file size down well below the posting limit.
Of cource, my mistake. Too bit in a hurry. Anyway, here is the project.
Mikael
I have notified our engineering team of the issue and forwarded your sample to them. I will update you tomorrow once I have a response.
I'm still waiting on a response from engineering. As soon as I get one, I will update you.
Just an update to let everyone know, this issue has been resolved in the latest service release.
You can download the latest service release by going to the Infragistics website and hovering over the "Account" tab then selecting "My Keys & Downloads" from the dropdown. On the "My Keys & Downloads" page you will see a list of product keys. Select the product key assigned to the product you wish to update and then scroll down the download list until you reach the Service Releases section.
I have logged this issue in our internal tracking system with a development ID of 102657. I have also created a private case for you that is linked to it. This will notify you automatically when a fix is available. The case number is CAS-83901-598F3X.
I will also update this thread when a fix is made available.
Excellent. I'm looking forward to the response.
Thanks