Legend for ArcGISOnline demographic layers

636
6
11-11-2010 05:38 AM
ApurvaGoyal
New Contributor III
Hello,

I have a silverlight application (arcgis api for silverlight version 1.2/ arcgis server 9.3.1) where user can select the type of demographic they want to display on the map. Once they select a demographic, I am then using an http handler for sending soap request to get legend for the selected demographics. It works most of the time. But sometimes I get a 404 exception for legend image on services2.arcgisonline.com. All I see at that point is a text in my control but no image for the legend.

Here is the request -
http://services2.arcgisonline.com/arcgisoutput/_ags_leg3988c43b89d84b03aee0fddb175d93f0.png

And the response is 404 not found.

Is that because this image is deleted at arcgisonline before I make the request?

Any help on this is highly appreciated.

Thanks

Apurva
0 Kudos
6 Replies
JenniferNery
Esri Regular Contributor
Yes, the 404 error means the file no longer exist on the server.

How are you getting the legends?  I found this archived forum thread with links to samples that might be useful to you. You can also try the live version to see if for that layer, the legend Url have been updated. http://forums.esri.com/Thread.asp?c=188&f=2226&t=287740

Also, this thread might be related if you are planning to use v2.1: http://forums.arcgis.com/threads/16639-ArcGIS-API-for-Silverlight-WPF-version-2.1-Release-Candidate
0 Kudos
ApurvaGoyal
New Contributor III
Jennifer,

Thank you so much for a quick reply. Yes I am using the following sample for getting the demographic legend-

http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=168...

This is the same sample as mentioned in the archived link.

Also sometimes I get this error message-

{"error":{"code":500,"message":"There was no endpoint listening at http://server.arcgisonline.com/ArcGIS/services/Demographics/USA_1990-2000_Population_Change/MapServe... that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."}}

Since the client needs to see the legend whenever they load a demographic layer, can you please suggest as to whats the best approach for demographic layer legends. Should we cache all the legends locally?

How do we resolve this issue of images getting deleted?

Thanks

Apurva
0 Kudos
JenniferNery
Esri Regular Contributor
I just tried the MapServer link you provided to the Custom REST Map Service Legends:
http://orthogonal.esri.com/restlegends/?soapUrl=http%3A%2F%2Fserver.arcgisonline.com%2FArcGIS%2Fserv...

It seems to work fine. Do you know if maybe the SL app is forming a different web request? You can find out by using Fiddler.
0 Kudos
ApurvaGoyal
New Contributor III
Well most of the times we do see the legend fine. But sometimes we get 404 exception and that 500 error. We assume that the legend images are always present on the arcgisonline.Is that a fair assumption? How do we make sure that we always get the legend back?

For the 500 exception, if I just reload the same demographic layer, I get the legend fine but sometimes we get that 500 exception.

Do these errors indicate that demographic services on arcgisonline is not always up? Should we consider caching the legend locally?

Thanks

Apurva
0 Kudos
JenniferNery
Esri Regular Contributor
I think that is a question for the REST API team http://forums.arcgis.com/forums/11-ArcGIS-Server-REST-API.

I'm really not sure why sometimes you get the legend and other times you don't. If you have already attempted to see the actual webrequest on Fiddler when a failure occurs and the same webrequest succeed at times, then it's probably a good idea to share this with them.

It would be great if you are able to reproduce this outside the SL app to be able to narrow down the problem. Kindly see post #14 in this thread: http://forums.arcgis.com/threads/14730-Area-And-Perimeter to guide you what to look for in Fiddler, it should be fairly similar.
0 Kudos
ApurvaGoyal
New Contributor III
Thanks Jennifer. Appreciate your help.
0 Kudos