Select to view content in your preferred language

Legend and SOAP method

2247
21
05-27-2010 03:24 AM
LanceCrumbliss
Frequent Contributor
hi all,

i've been using the SOAP method to return legend images for a while now.  i've noticed lately that on occasion, while the GetLegendInfo() method successfully executes on the server and returns to the client app the URL's pointing to the png files created on the server's arcgisoutput directory, that sometimes the png files are not actually created.  fiddler of course will show a 404 error for each image attempted to be retrieved.  it usually happens after the method has been called on the same service several times .  maybe 20 or so over the course of 3 or 4 hours...i noticed this issue while debugging the app.  of course, debugging hits the map service and makes the SOAP call.  it will eventually right itself, but again, it may take several hours.  restarting the map service, server, or reloading the client app doesn't resolve the issue.  what would be the cause of this?

lance
0 Kudos
21 Replies
LanceCrumbliss
Frequent Contributor
hm, setting the cache in code to 9 minutes and the arcgisoutputdirectory MaxFileAge to 10 minutes didn't resolve the issue either.
0 Kudos
LanceCrumbliss
Frequent Contributor
i'm wondering if anyone from ESRI has a suggestion as well?  this is a bit of a show-stopper at the moment.
0 Kudos
nicogis
MVP Frequent Contributor
The problem that I say you however there is (cache).

I advise you do debug or set message (in source code) in log so you can understand where is the problem. I don't know how help you.
0 Kudos
dotMorten_esri
Esri Notable Contributor
What happens if you disable caching in the REST endpoint? Or have the rest endpoint do caching of the images instead of just the URL to the images?
0 Kudos
LanceCrumbliss
Frequent Contributor
What happens if you disable caching in the REST endpoint? Or have the rest endpoint do caching of the images instead of just the URL to the images?


i will try both of those.  trying the first suggestion now.  of course, with every hit to the page, a new set of legend images are added to the arcgisoutput directory (to be expected when not caching).  i'll see how it behaves over time and then try the second approach.
0 Kudos
RyanCoodey
Frequent Contributor
I just implemented this legend control (It's great, thanks a lot SharpGIS)... but I am having the EXACT same problem! 

-After 10 minutes (the MaxFileAge) the legend images go away, this is expected, but why doesn't the Legend.ashx trigger these to be re-created after they have been cleaned out?
- As ciava.at mentioned, I see the Legend.ashx does something with caches at 15 min, but I am not sure what?  Sorry, not real familiar with SOAP...
- It is some random time after the images have been cleaned out until Legend.ashx will then trigger them to be re-created (one time it was about 20 min, once an hour)... not sure what triggers it.


What happens if you disable caching in the REST endpoint?

What do you mean by this?  The ArcGIS Server service is not caching. The REST API cache is set to be cleared daily at 1:00 am.  Are you saying to disable caching (aka cleaning) on the arcgisoutput directory?  I see how this would work, but I ideally don't want to disable this for all the other services that are running just to fix this problem... I am fine with it for the legend images, but preferably not everything else.  Maybe I can set the time up to like an hour.


Or have the rest endpoint do caching of the images instead of just the URL to the images

I see what you are saying here, but not sure how to do this, could you please elaborate a bit more?

Thanks a lot for any help!
0 Kudos
dotMorten_esri
Esri Notable Contributor

What do you mean by this?


I was referring to the custom rest endpoint in the sample. It's doing caching for the 10 mins, but you could just pull that code out of the sample.
0 Kudos
RyanCoodey
Frequent Contributor
I was referring to the custom rest endpoint in the sample. It's doing caching for the 10 mins, but you could just pull that code out of the sample.


Oh, gotcha, thanks!  That did the trick! 

This got me tinkering with your code a bit and learning about System.Web.Caching.Cache and from what I can tell, it was the fact that it is using a "Sliding Expiration" that it had this problem... I set it to use an "Absolute Expiration" (of 5 min just to make sure) and I think that should still allow some caching (for excessive hits) but not have this problem.

Thanks a lot!
0 Kudos
dotMorten_esri
Esri Notable Contributor
Oops! Good find
0 Kudos
PANKAJBOBADE
Deactivated User
Hi There,
I am completely new to ArcGIS Java Script APIs and currently facing problem to display symbology / legend. i have downloaded the TOC sample from net & its shows Layer names properly in tree control [just like arcmap] without symbology. When checked author told that componety either expects ArcGIS 10 or application server to be in public domain.
Currenl;y i am working on ArcGIS 9.3.1 with REST APIs.

Any body can help on this related to sample if any available using getLegendInfo & java script.

Thanks in advance.
0 Kudos