Select to view content in your preferred language

Dynamic Map in Silverlight Is Appearing Blank

3991
10
Jump to solution
03-10-2011 11:26 AM
by Anonymous User
Not applicable
Original User: nelsl

My map through my simplified Silverlight app is appearing blank.  I have tried in IE 8 and firefox 3.6.15.  I have tried using Fiddler and found:
that my clientaccesspolicy.xml is being accessed under code 304
A successful 200 call to /ArcGIS/rest/services/[service name]/MapServer?f=json
Then the error 500 http://[server name]/ArcGIS/rest/services/[service name]/MapServer/export?bbox=-469791.006899998%2c-...

My log located at: C:\Program Files\ArcGIS\Server10.0\server\user\log
reports:
<Msg time='2011-03-10T13:57:12' type='WARNING' code='2008' target='[service name].MapServer' user='?' thread='3628' elapsed='59.99900'>A request to obtain a free ServerContext has failed because the Wait Timeout Interval has elapsed.</Msg>
<Msg time='2011-03-10T13:59:38' type='WARNING' code='2007' target='[service name].MapServer' machine='[server name]' thread='2692' elapsed='605.16800'>The context has been automatically released because the Context Usage Timeout Interval has elapsed.</Msg>


My Service is listed under: http://[service name]/ArcGIS/rest/services

My code is:
            <esri:Map x:Name="MyMap" >
            <esri:ArcGISDynamicMapServiceLayer ID="MyLayer"
                                               
                Url="http://[server name]/ArcGIS/rest/services/[service name]/MapServer" InitializationFailed="ArcGISDynamicMapServiceLayer_InitializationFailed" 
                                               Visible="True"/>
        </esri:Map>

which loads a blank page:
Url="http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer" />

does load successfully.  The Initialization Failed Event does not fire.

I tried the analyze tool under the Map Service Publishing Toolbar and corrected all errors.
The service does show up correctly in ArcMap and the preview of the service in ArcGIS Server Manager.

Attached are my policies located under default: C:\Inetpub\wwwroot of the SOM/SOC machine.  My version of Visual Studio 2010 is running on a different box and is using IIS 6.
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: jenniferdnery

Okay from what I understand, your application shows blank map but InitializationFailed event is not raised and you are able to access the service from any web browser so clientaccesspolicy is not the issue.

Can you go to the sub layers and do a query for "1=1", check if you have features for this service?

For example this: http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/Incident_Data_Extraction...

If you have features, you should see them on your map. If you don't see them, you can also subscribe to ArcGISDynamicMapService Initialized event and check the following:
InitializationFailure is null and IsInitialized is true, sub layer DefaultVisibility should also be true.
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{  
 ArcGISDynamicMapServiceLayer layer = sender as ArcGISDynamicMapServiceLayer;
 if(layer.InitializationFailure != null && !layer.IsInitialized) return;
 foreach(var l in layer.Layers)
  //TODO: check for l.DefaultVisibility
}


I found this and I'm not sure if it is the same error 500 Internal Server Error you got: http://gis.stackexchange.com/questions/6693/how-to-handle-500-internal-server-error-with-esri-silver...

This is the simplest map with only the ArcGISDynamicMapServiceLayer and only the Map inside the Grid: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DynamicMap. I wonder if you have other control that could possibly be on the same grid as the map that placed the map behind it.

View solution in original post

0 Kudos
10 Replies
by Anonymous User
Not applicable
Original User: jenniferdnery

I'm assuming you have already went over this blog post? http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx


Can you view the map from your web browser?

For example this map service http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer can be viewed by clicking ArcGIS JavaScript and ArcGIS.com Map from the top page.
0 Kudos
NelsLarsen
Emerging Contributor
When I click on the ArcGIS JavaScript link I can see my map.
0 Kudos
by Anonymous User
Not applicable
Original User: jenniferdnery

You opened your map service from a web browser that is not your server machine?

If there were clientaccesspolicy issues, you also will not be able to browse for the map service information from your web browser. Fiddler should show the same error message that you got from your Silverlight app.
0 Kudos
by Anonymous User
Not applicable
Original User: jenniferdnery

Fiddler report seem okay. I'm sorry if you have already answered this question. But this is through a web browser from a different machine (not your server machine)?
0 Kudos
NelsLarsen
Emerging Contributor
The machine I am using is not the server machine.
http://vg23138/ArcGIS/rest/services/
where vg23138 is my server
http://localhost/ArcGIS/rest/services/
does not work on my machine.  It does work on the server box.
0 Kudos
by Anonymous User
Not applicable
Original User: jenniferdnery

Okay from what I understand, your application shows blank map but InitializationFailed event is not raised and you are able to access the service from any web browser so clientaccesspolicy is not the issue.

Can you go to the sub layers and do a query for "1=1", check if you have features for this service?

For example this: http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/Incident_Data_Extraction...

If you have features, you should see them on your map. If you don't see them, you can also subscribe to ArcGISDynamicMapService Initialized event and check the following:
InitializationFailure is null and IsInitialized is true, sub layer DefaultVisibility should also be true.
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{  
 ArcGISDynamicMapServiceLayer layer = sender as ArcGISDynamicMapServiceLayer;
 if(layer.InitializationFailure != null && !layer.IsInitialized) return;
 foreach(var l in layer.Layers)
  //TODO: check for l.DefaultVisibility
}


I found this and I'm not sure if it is the same error 500 Internal Server Error you got: http://gis.stackexchange.com/questions/6693/how-to-handle-500-internal-server-error-with-esri-silver...

This is the simplest map with only the ArcGISDynamicMapServiceLayer and only the Map inside the Grid: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DynamicMap. I wonder if you have other control that could possibly be on the same grid as the map that placed the map behind it.
0 Kudos
JenniferNery
Esri Regular Contributor
I don't know if you were able to resolve this issue. But I came accross this help page from ArcGISServer and maybe you can look at the troubleshooting section for "when map is blank".
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//0093000001mq...
0 Kudos
by Anonymous User
Not applicable
Original User: nelsl

I queried using the where clause of 1=1 and many rows were returned using different layers.

I checked all the DefaultVisibility for all the layers and they all appear as shown (true).  The layer object is returning values for all the layers.  I checked the initial extent and it seems to be reasonable. 

The 500 silverlight error quoted is a different error.

I am using the code from the example with the only change of being linked to my service.  There are no other controls on the web page.
0 Kudos