Select to view content in your preferred language

Legend and SOAP method

2048
21
05-27-2010 03:24 AM
LanceCrumbliss
Occasional Contributor II
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
dotMorten_esri
Esri Notable Contributor
I wouldn't recommend using SOAP to ArcGIS Server. The proxy generated is enourmous, and the overhead is even bigger (no caching at all). It just doesn't scale very well. Have you looked at this approach instead: http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=168...
0 Kudos
LanceCrumbliss
Occasional Contributor II
I wouldn't recommend using SOAP to ArcGIS Server. The proxy generated is enourmous, and the overhead is even bigger (no caching at all). It just doesn't scale very well. Have you looked at this approach instead: http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=168...


that is the approach i'm using.  perhaps i worded it incorrectly in my original post.  maybe i'm mixing terms here.  GetLegendInfo() is a SOAP method and is being called on the web server, not the client, and the results (urls to the images) are sent back as a string to the client.  what i meant was that sometimes the GetLegendInfo() method doesn't actually create the png files in the arcgisserver/arcgisoutput directory, but still returns a path to them.

hopefully that's correctly described now.  any guess as to why the images are not generated sometimes?

lance
0 Kudos
nicogis
MVP Frequent Contributor
Have you checked in logs?
0 Kudos
LanceCrumbliss
Occasional Contributor II
Have you checked in logs?


Yep.  no errors on verbose.
0 Kudos
nicogis
MVP Frequent Contributor
I have seen that from live it view ( http://silverlight.sharpgis.net/ArcGISLegend.html ) that are created image with prefix '_ags_'. Arcgis server clear this images after 10 minutes . you try see your settings cleaning mode
0 Kudos
LanceCrumbliss
Occasional Contributor II
I have seen that from live it view ( http://silverlight.sharpgis.net/ArcGISLegend.html ) that are created image with prefix '_ags_'. Arcgis server clear this images after 10 minutes . you try see your settings cleaning mode


hm, not sure where that specific setting is.  but in the Server Manager, I can edit the arcgisserver/arcgisoutput directory to have a maximum file age of XX minutes, and it's currently set to 30 and the cleaning mode is set to "based on time elapsed since last accessed".  are those the settings you're referring to?
0 Kudos
nicogis
MVP Frequent Contributor
<Cleaning>sliding</Cleaning>
<MaxFileAge>600</MaxFileAge>


for details see
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//0093000000mq...
0 Kudos
LanceCrumbliss
Occasional Contributor II
<Cleaning>sliding</Cleaning>
<MaxFileAge>600</MaxFileAge>


for details see
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//0093000000mq...


yeah, that's the same setting as in the Server Manager, and it's currently set to 30 minutes (1800 seconds in the .dat file), last accessed (sliding in the .dat file).  i don't see how this could be the cause of my problem though.
0 Kudos
nicogis
MVP Frequent Contributor
I have seen the code of #gis.

I think that the problem is here:

Layer[] legend = null;
     if (context.Cache[soapUrl] != null)
      legend = context.Cache[soapUrl] as Layer[];
     if(legend == null)
     {
      legend = LegendGenerator.GetLegend(soapUrl);
      context.Cache.Insert(soapUrl, legend, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(15), System.Web.Caching.CacheItemPriority.AboveNormal, null);
     }
     if (isJson)
     {
      GenerateJson(context, legend, isPrettyJson);
     }


If cache is used until 15 minutes, it uses legend in cache without regenerate legend image. So your 10 minutes can have an interval of 5 minutes without images because they are clean from server! In code should be set value <=MaxFileAge .
0 Kudos