> Script Details
Custom REST Service - Map Service Legends
report inappropriate content
ArcGIS Server Development Team
Feb 9 2010
Status of work
ESRI Attribution and Licensing Agreement
ArcGIS Server (10.0 and prior)
ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.
The ArcGIS Server REST API does not support map service legends. The SOAP API does. This is a custom REST service written in Java that provides this functionality.
[UPDATE #3: The .NET version of this sample is available here:
[UPDATE #2: Fixed a bug with null legend classes reported by Dave Bouwman.]
This service supports 3 parameters:
soapUrl - Required. URL of the SOAP endpoint of the map service.
f - The response format: html, json, pjson (pretty json). The default format is html.
This service uses the JSON in Java library from: http://www.json.org/java/
It also uses the ArcGIS Server SOAP client library that you can reference from your ArcGIS Server installation.