How do I know programmatically if to use a dynamic or tiled map service?

Discussion created by mathias.dahl on Jun 15, 2013
Latest reply on Jun 19, 2013 by mathias.dahl

We are building a quite special integration with ArcGIS where we want
the services and their layers to be chosen according to a certain
configuration each time the map application is loaded. So in one
situation the map will show layer X, Y and Z from service A and B and
in another situation we will show other layers from other
services. The code has to be dynamic.

My question is now, given a certain map service, how can I know if I
should create a dynamic map service layer or a tiled map service
layer? Since my web page, the actual map application, will get the
list of layers/services sent to it I would like to programatically ask
the service or the ArcGis Server directory what type it is.

From what I can gather there is no easy way to distinguish between a
tiled map service and a dynamic one. A feature service will be
published under a URL with "FeatureServer" in the path, but for the
map services it will always be "MapServer".

Any ideas on how to do this? If it cannot be done, the administrator
who defined has to specify the type of a service in the basic data we
are building for this, but I would like to avoid that if possible to
not put that burden on the admin.