I am trying to fetch the names of the layers in the MapService, so that I can populate them in the dijit.form.select. I am able to get the layerInfo
when the ArcGISDynamicMapServiceLayer is added to the map by using,
map.getLayer(map.layerIds[0]).layerInfos[0].name
But this is only after the layer has been added to the map. Is there some way by which I can get the layerInfo names directly from the URL?