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

In the documentation for using handler functions with ArcGIS Server Rest SOE's, they don't explain how the keys in the boundVariables collection are determined. When I search through the entire solution for "customLayersID" I don't see anything. How would I know to use "customLayersID" as a key?

private byte[] CustomLayer(NameValueCollection boundVariables, string outputFormat,
    string requestProperties, out string responseProperties)
    responseProperties = null;

    //The LayerID.
    int layerID = Convert.ToInt32(boundVariables["customLayersID"]);

    CustomLayerInfo layerInfo = GetLayerInfo(layerID);

    string json = layerInfo.ToJsonObject().ToJson();

    return Encoding.UTF8.GetBytes(json);
share|improve this question
up vote 5 down vote accepted

The bound variable key takes the form of the resource name + "ID".

This is not very clearly stated in the conceptual document you linked to, but I remember seeing it somewhere.

EDIT: See this PDF, slide number 45. Resources seem to be always identified by their identifier (id), which is ok, but I personally find this string-convention-based design very weird. I should also note that the slides are a little outdated and do not exactly match the shipped version of the API.

One last (pedantic) complaint - ESRI will apparently never learn that id is not an abbreviation and as such should not be spelled in uppercase :-)

share|improve this answer
Thanks petr k.! – Kirk Kuykendall Nov 1 '10 at 21:25

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.