Select to view content in your preferred language

Dynamic Rest Legend in ArcGIS Server 10 and Flex API 1.3

4853
28
08-13-2010 07:26 AM
JasonHancheruk
Emerging Contributor
I just upgraded ArcGIS Server to version 10 from 9.3.1. When I open the Flex page through the browser, instead of the dynamic legend loading, the wait for legend creation just keeps spinning.

Is there a way to fix this problem?
Tags (2)
0 Kudos
28 Replies
JasonHancheruk
Emerging Contributor
Update.

It appears the error shown in the previous post only happens when initially opening the Flex page. To test, I opened the application page, then zoomed in (sometimes once, other times twice) and the map legend appeared as normal. Robert, do you have any ideas on the cause?

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

   Well there is no error in your LiveMapsWidget.mxml as I took it and only changed the url of the wsdl and it worked just fine for me when I used your code in my viewer.

   When you tested the asp.net web service on your server as I mentioned in my previous email did you happen to copy one of the image urls and test to see if it displayed and image when you put it in a browser?

   Also have you put http://AFR112PROD4/restLegend/restLegend.asmx?wsdl in a browser and seen it bring up the wsdl file for your to see?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shaf,

   The file is not damaged this is a known issue with this forum when you try to use Internet Explorer to download a zip file. Try and use Firefox or Google Chrome instead. Also be warned that this is not something that is easy to implement even for a non-beginner in Flex.
0 Kudos
JasonHancheruk
Emerging Contributor
Hi Robert. Yes I did test to see if the image came up, and I had no problems connecting to any of them in the xml. Since they always work, but not right away, could it be a timing issue where the legend request is timing out before the app gets a chance to populate the legend?

Thanks,
0 Kudos
JasonHancheruk
Emerging Contributor
Hi Robert. Is there anyway to pause the creation of the Legend? When I look at the error through Fiddler (below), I am thinking the legend is trying to start before the server is ready.

Yes/No, any help would be great.

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---&gt; The request failed with HTTP status 404: Service Not Found or Not Started.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>


Thanks,
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

   You have your LiveMapsWidgets coming up with the legend from the start right? Can you instead have it open to the TOC and then let the user switch to the legend?
0 Kudos
JasonHancheruk
Emerging Contributor
Ignore the the last post. It was the aerial imagery in a map service.

Sorry, forgot about that issue.

http://forums.esri.com/Thread.asp?c=158&f=2421&t=299116

Thanks,
0 Kudos
JasonHancheruk
Emerging Contributor
Hi Robert.

I have been playing around with the dynamic legend, and I am still getting the error. The error only happens the first time I open the legend, and hitting the browser refresh button fixes it.

If I remove the service that contains the rasters (from the config file), the problem does not appear at all. This does include adding the raster service to code as mentioned in the previous post.

I am wondering if you have any ideas on why this may be happening?

Thanks,
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

   Rasters can not be part of a map service that you are generating a legend for. That is just a limitation of the code. I have advised others in the past to just separate out raster layers to their own map service and then exclude them from the legend code.
0 Kudos
JasonHancheruk
Emerging Contributor
I have three different services opening, with one containing rasters. I don't remember the forum where you showed how to remove the specific service layer from the legend.

Thanks,
0 Kudos