ArcGIS 10.0 sp1 and Silverlight API 2.0-2.1 Exception

577
3
03-31-2011 02:51 AM
VasylMelnychuk
New Contributor
Hi All

I have installed SP1 for ArcGIS 10 and now I am getting exception in my Silverlight API if ArcGIS Dynamic Layer url is invalid.
Exception is handled in Application.UnhandledException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer.MapServiceInfoInitialized(Object sender, MapServiceInitalizeArgs args)
   at ESRI.ArcGIS.Client.Services.MapService.OnInitialized(MapServiceInitalizeArgs args)
   at ESRI.ArcGIS.Client.Services.MapService.wc_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadStringCompleted(DownloadStringCompletedEventArgs e)
   at System.Net.WebClient.DownloadStringOperationCompleted(Object arg)


Difference in response in 10 and 10 with SP1
10:
{"error":{"code":400,"message":"Unable to complete  operation.","details":["Service 'M' of type 'MapServer' does not exist or is inaccessible."]}}

10 with SP1:
{"currentVersion":10.01,"error":{"code":400,"message":"Unable to complete  operation.","details":["Service 'M' of type 'MapServer' does not exist or is inaccessible."]}}

Seems like Silverlight API do not understand 10 with SP1 response as error, trying to to use this response as success and gets NullReferenceException as this response does not contains some required attributes.

I cannot just handle this like error, as I am waiting Layer.Initialized event in app logic (and it is not fired in this case).

Does anyone knows how to fix this?


Software:
ArcGIS 10.0 with SP1
ArcGIS Silverlight API 2.0 and 2.1

Regards,
Vasyl
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
Thanks for reporting that.
We'll try to get it fixed ASAP.
0 Kudos
İsmailZAMBAKCI
New Contributor II
Hi,
Im using flex api to view arcGISServer 10 map services.
I handled this error too on flex application. But I understand this error fires when the server instance creation firstly.
If you make thats you can understand some things.
Go to the http://hostName/ArcGIS/rest/services/SampleServer/MapServer?f=jsapi on an internet browser and add the same service to the silverlight or flex map . Then you will see this error doesnt fires again.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Thanks for reporting that.
We'll try to get it fixed ASAP.


That will be fixed in 2.2 final, i.e. this kind of response will fire 'InitializationFailed' event.
0 Kudos