ArcDeveloper REST: U R I and I R U
http://<yourServer>/rest.svc/service/layer/3?format=geojsonIt's clear and easy and other URI endpoints are easy to deduce. Yup, we are RESTing we the best of them. Our main endpoint is the rest.svc, which is WCF's way of exposing a service endpoint. The first question, then, we had to answer was how we would handle the URI routing. If the map services are registered dynamically (using Castle Windsor, which is arguably the greatest piece of code ever written. Ever. Not that I am prone to hyperbole. Oh, I'll cover the configuration in the next post) then we have to dissect the various pieces of the URI to:
- Get a hold of the service requested.
- Query the right layer
- Use the right query parameters.
- Grab the right formatter.
Stream GetSingleFeatureJSON(string serviceName, string featureType, string featureId, bool geom);