Using ArcGIS Server geoprocessing services

Toolboxes can reside in ArcGIS Server. A toolbox in ArcGIS Server is called a geoprocessing service. Tools within a geoprocessing service are called tasks. In ArcGIS Desktop, there is no real difference between geoprocessing services and toolboxes or between tasks and tools; it is only for other clients of ArcGIS Server (such as web browsers and other Internet-based software) that a distinction is made between services and toolboxes, as well as tasks and tools.

You can add a geoprocessing service to the Catalog window and use its tools just like any other tool. When you execute a geoprocessing task within a service, it executes on the server, using the resources on the server, freeing up your computer for other tasks.

Learn more about GIS services

There are two ways of finding services: browsing or searching. In both cases, you need to first connect to the server (you only need to connect once), and you must know the URL of the server to connect to it.

Browsing services

Your first step is to connect to ArcGIS Server. From within the Catalog window

NoteNote:

In order to browse to and use geoprocessing tasks, you must connect to the server as a user (in the Add GIS Server dialog box, Use GIS Services is checked), not as an administrator (Manage GIS Services).

Searching for services

  1. Ensure your GIS server has been indexed as described in Using search in ArcGIS and illustrated below.
  2. In the Search window, search for tasks (tools) just as you would for local tools.
Indexing your GIS Server(s)

Executing geoprocessing tasks

You execute geoprocessing service tasks just as you do with any other tool—from the tool dialog box, within ModelBuilder, or within a script. The only difference is if you're executing tools in the foreground—some tasks wait for the results to be sent back from the server while others don't wait; they submit the task to the server and occasionally query the server for the result. You use the Results window to observe the status of tasks submitted to the server. The section below, Synchronous and asynchronous tasks, describes this in more detail.

Working with task results

The result added to the Results window by a geoprocessing task displays the status of its output datasets rather than the names of the datasets. There are five different values for status:

<empty>

The tool is still executing on the server and no output has been written. This status only applies to asynchronous tools. See Synchronous and asynchronous tasks below for more information.

<data in local temp location>

The tool has finished executing and the output data resides in either your computer's memory or your system temp directory. The data will not be deleted as long as you have an ArcMap layer that references the data. If you want to preserve the data, you should copy it from this temporary location to a known location. An easy way to do this is to use the Copy tool, dragging the dataset from the result into the input features parameter of the tool. You can also right-click the output and click Copy Location, which will copy the path of the feature class to the clipboard, allowing you to paste it anywhere that accepts text, such as the input features parameter to the Copy tool.

<data on server>

The data resides on the server. It also means that there is a result map service that will draw the data in ArcMap, ArcGlobe, or ArcScene. This result map is automatically added to the table of contents when the tool finishes executing on the server. If you need to add this result map service to the table of contents, right-click the result and click Add Server Layer.

You can also right-click the result and click Get Data, which will copy the data from the server to your computer. After copying, the status will either be <data in local temp location>, <data exceeds transfer limit>, or <data unavailable>.

<data exceeds transfer limit>

The Get Data action was not able to transfer all the data from the server to your computer because the maximum number of features to transfer was exceeded. Copying large datasets degrades the server's ability to execute other GIS services and clogs the network. Therefore, the service author specifies a maximum number of features that can be copied from the server to a client computer. If you need to copy data that exceeds the limit, you need to contact the service author or server administrator and arrange for other ways to get the data.

<data unavailable>

The Get Data action could not find the data on the server. The most likely cause is that the server administrator determined that the task results were obsolete and deleted the data to free up space on the server.

Environment settings are ignored

Geoprocessing services explicitly set any environment settings that affect execution of the task and ignore all environment settings that you set within your current session. The only exception to this rule is for tasks that output raster datasets or files (such as a .zip file). For these tasks, the raster dataset or file is written to the system temp directory.

Copying server task to a local toolbox

You can copy a task from a geoprocessing service to a custom toolbox (one that you create). If you execute the copied task from your custom toolbox, it will still execute on the server.

Exiting an application before a server tool completes execution

Once you've submitted an asynchronous tool (see below), you can exit the application you are working in. For example, if you're working in ArcMap, you can start execution, save the map document, and exit ArcMap. When you open the document later, ArcMap will query the server, check the result status, and update the result in the Results window. If you are going to use this method of starting execution and exiting ArcMap (or ArcGlobe or ArcScene), be sure to save the map document to save the result for later inspection.

Synchronous and asynchronous tasks

Geoprocessing services and their tasks are either synchronous or asynchronous. Synchronous means that your computer will wait while the task executes on the server. Asynchronous means that your computer doesn't have to wait for the tool to finish execution and you can move on to other tasks.

It is up to the publisher of the service to decide whether a task executes synchronously or asynchronously. Only tasks that execute quickly and have small output datasets should be published as synchronous tools.

Learn more about publishing a toolbox to ArcGIS Server

There are two ways to determine if a server tool is synchronous or asynchronous:

When you execute an asynchronous tool within ArcMap and have enabled the adding of tool results to the display, a layer will be added to the display but will not be visible (checked on). This is because ArcMap doesn't know when the tool will finish executing and have output to draw.

You are not automatically informed when an asynchronous tool finishes execution. You track the progress of an asynchronous tool in the Results window. When the tool is executing, an hourglass will be displayed next to the result. You can cancel execution by right-clicking the result and clicking Cancel.


12/15/2011