Services Directory allows you to browse the contents of an ArcGIS Server and obtain information that can be useful to you when developing applications. Services Directory is a view of the ArcGIS Server REST API in HTML format. Each ArcGIS Server instance has Services Directory installed during the installation process.
Services Directory helps you do these things:
Browse the contents of the GIS server and get service level metadata
You can navigate a series of links to view information about the services on your GIS server. The links also allow you to preview how your service looks in ArcMap, in a Web browser, in Google Earth, and so on.
Get information to help you develop applications
When you develop applications with the JavaScript APIs you must provide URLs to services and the layers and functionality they expose. Services Directory provides an interactive way for you to construct those URLs.
Services Directory works using REST. REST is an architectural style that allows ArcGIS Server to reveal a hierarchy of information about itself through endpoints, or URLs. When you use Services Directory, you navigate through a series of links to discover information about the server. Every time you click a link, you see a new page that reveals additional information about what's available on the server. The information that you see on the page was retrieved through REST using the page's URL.
When you open Services Directory, you first see the home page, which lists all services in the root directory along with any folders containing additional services. In addition to the name of the service, you can see what the service type is such as MapServer or GeocodeServer.
Note: The server administrator determines the folder structure. You cannot control this through Services Directory.
Click on a service name to get more information. The available information varies depending on the type of service. If you click a map service (MapServer), you will see information such as layer names, document information, and supported interfaces.
If you continue clicking through the levels of links, you can get information about the individual layers in the service. In this way, Services Directory exposes a large amount of metadata for your services.
Viewing footprints of your server
A footprint is a geographic catalog of all your services. When you choose to view the footprints of your server, it opens a feature collection in ArcGIS.com Map showing a place-mark for each available service. Clicking on the place-mark reveals more information about the service in a pop-up dialog.
If you choose to view footprints at the root level of the server, you will see services from the root level. You can also view footprints at each folder level.
You can use footprints to show what's on your server. You can use the Services Directory to discover the URL to your footprint. Right click on the footprint link to copy the footprint URL. Then when you share the URL with others, they can always get the most up-to-date view of what's available on your server. Note that arcgis.com supports viewing of footprints only when the services are unsecured or when secured using token based authentication.
Viewing maps
When you publish a map service, you can get the contents in several different formats using Services Directory. When you navigate to a map service's page, you see the option to "View In" different applications. These include:
Generating KML
All map and image services have a KML network link available that you can browse to using the "View In: Google Earth" link mentioned above. If you want a network link with properties or feature types other than the default, such as the vector feature type, you can use Services Directory to generate your own KML network link.
To generate your own KML network link, navigate to the page of the map service you want to view. From the Map Operations list, click the Generate KML link.
Note: The Generate KML link is not available if the server administrator has disabled the KML capability for the service. The link is also not available if services are secured using token based authentication.
On this page you can set some basic properties for your KML network link, including the name, the layers to include, and the layer drawing options. If you want to see vector features, choose the third option: "Vector layers as vectors and raster layers as images".
Note that the server administrator may have limited or disabled some of the options you might otherwise be able to set for your network link in Services Directory. For example, the administrator may have disabled the ability for the server to return vector features, or the administrator may have set a limit on how many KML features the server can return.
Once you generate the network link, you can distribute it to others as needed. One advantage of distributing a network link instead of static KML is that the network link points to the KML capability on the map service. Referencing dynamic KML in this way ensures that you will always see the most up-to-date features.
Services Directory can help you get information that you need when developing JavaScript applications. The JavaScript APIs included with ArcGIS Server are based on REST, and every ArcGIS Server exposes its information through REST endpoints or URLs. Each endpoint returns some piece of information about the server or one of its services.
For example, using the ArcGIS Server JavaScript API, you can write some code that displays a map in a Web browser. This code requires the REST endpoint of the map service, which might look something like this:
http://servicesbeta2.esri.com/arcgis/rest/services/Water_Network_Base_Map/MapServer
How do you know how to construct this endpoint? If you are familiar with ArcGIS Server, you might be able to construct the endpoint from memory. But it's more likely that you would use Services Directory to help you discover the endpoint. Using Services Directory, you can browse through the contents of your server until you reach the map service. You can then copy the URL out of the browser and paste it in your code.
Examples of how to use Services Directory in your development
The code to add a cached map to your application looks something like this:
myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer ("http://servicesbeta2.esri.com/arcgis/rest/services/Water_Network_Base_Map/MapServer"); myMap.addLayer(myTiledMapServiceLayer);
Notice the URL for the REST endpoint of the map service (servicesbeta2.esri.com/arcgis...). If you did not know this URL, the following steps could help you discover it using Services Directory:
Copy the URL from the browser and paste it in your code.
Sometimes you need to work with an individual layer in the map. For example, the code to set up a query on a layer starts like this:
function init() { //build query myQueryTask = new esri.tasks.QueryTask ("http://servicesbeta2.esri.com/arcgis/rest/services/Water_Network_Base_Map/MapServer/78"); . . .
The URL used in the code above looks a lot like the URL for the map, with the addition of an index (in this case, "78") that tells which layer to get. The index comes from the position of the layer in the map's table of contents. Since you might not immediately know the index, you can use the Services Directory to find it.
To see how this works, return to Step 3 above. Before you copy the URL, look down at the information on the page about the "Water_Network_Base_Map" map service. You will see a clickable list of layers. Clicking on any layer gives you a new URL with the layer index that you can use inside your code.