[GIS] Getting mapserver url from ArcGIS Server

arcgis-server

I have been creating some web-map applications using GoogleMaps Javascript API v3.

I've been bringing in tiles from ArcGIS servers which is really easy using the API.

The code below loads a sample dataset from ArcGIS.com.

var url = 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer';
var agsType = new  gmaps.ags.MapType(url,{name:'ArcGIS'});
map.mapTypes.set('arcgis', agsType);
map.setMapTypeId('arcgis');

I have some clients that already have a public ArcGIS server online and in place. When I ask them for the MapServer URL, they don't know where to find it or how to generate it for their datasets.

I don't know anything about ArcGIS server and have not been able to find the appropriate info in ESRI help docs.

Could someone point me to some info about generating an appropriate MapServer URL that I could then pass onto my clients?

Best Answer

By default, ArcGIS Server for Java listens on port 6080 and its REST services directory is accessible at the path /arcgis/rest/services. So, given a host name, chances are you can browse its services directory using the following URL structure:

http://server.example.com:6080/arcgis/rest/services

From there, you'll find a list of services and/or folders with services in them. The path to a service's MapServer follows this format:

http://server.example.com:6080/arcgis/rest/services/foldername/servicename/MapServer

or, if it's not in a folder at all, just:

http://server.example.com:6080/arcgis/rest/services/servicename/MapServer

EDIT: As mwalker pointed out below, this is only the case for the Java version of ArcGIS Server. The .NET version listens on port 80 via IIS, so the base URL should simply be:

http://server.example.com/arcgis/rest/services

EDIT #2: It looks like at version 10.1 of ArcGIS Server, both the Windows and Linux versions listen on port 6080 by default. If you want another port to be used, you need to install the ArcGIS Server Web Adaptor. For more information, see: http://resources.arcgis.com/en/help/main/10.1/index.html#/Migration_to_ArcGIS_10_1_for_Server/0154000002p0000000/

Related Question