Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using ArcGIS Server 9.3.1 SP 1. I want to be able to determine the capabilities of each published layer, specifically I am looking for all layers with query capabilities.

Being familiar with ArcGIS Server 10 I thought I could programmatically inspect the capabilities list on the layer response page. For example, Average US Household Size has MAP, QUERY, and DATA capabilities.

However it appears that ArcGIS Server 9.3.1 does not publish layer capabilities through the REST API. I think that I could get this information by scraping the HTML for the layer resource and looking for the list of supported operations in the HTML.

<a href="/ArcGIS/rest/services/Demographics/USA_Average_Household_Size/MapServer/1/query">Query</a>

But this seems like brittle code.

How would you programmatically determine if a layer supports the query capability via the ArcGIS Server 9.3.1 REST API?

share|improve this question

Here is an article that shows how to get all the service layer's information:

How to Get ArcGIS Server Layer Information

share|improve this answer
Unfortunately, the REST API at 9.3.1 does not expose the layer's capabilities on in JSON response as far as I can tell. – Ryan Taylor Mar 25 '12 at 15:42
You're right, this will work only with the 10 API, the 10 API will return the parameter: '"capabilities" : "Map,Query,Data"' – Khattab Mar 25 '12 at 20:03
up vote 0 down vote accepted

Unfortunately, the only way to programmatically determine if an ArcGIS Server 9.3.1 Layer has query capabilities is to make a GET request for the layer's resource page and search for "Query Layer" HTML content.

Here is a bit of Flex code that does just that. I specifically first search for "Support Operations" text and it's location in the content. If that is found I then search for "Query Layer" but only if it appears after where "Support Operations" was found to reduce chances of false positives. It's not ideal but it works in a pinch.

Error handling has been removed to simplify the example.

var layerResourcePage:HTTPService = new HTTPService(); 
layerResourcePage.url = layerUrl;
layerResourcePage.method = "GET";
layerResourcePage.resultFormat = HTTPService.RESULT_FORMAT_TEXT;

var asyncToken:AsyncToken = layerResourcePage.send();
var asyncResponder:IResponder = new AsyncResponder(onLayerResourcePageLoaded, onLayerResourcePageFailed, token);

function onLayerResourcePageLoaded(result:ResultEvent, token:Object):void
    var html:String = result.result as String;

    var supportedOperationsIndex:int = html.indexOf("<b>Supported Operations: </b>");
    var supportedOpsFound:Boolean = supportedOperationsIndex != -1; 
    if (supportedOpsFound == true)
        var queryCapabilityIndex:int = html.indexOf("Query Layer", supportedOperationsIndex);
        _queryCapabilityFound:Boolean = queryCapabilityIndex != -1;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.