A geoprocessing service that has been published to ArcGIS Server, whether on its own or as part of a web tool, can be used in a variety of applications. Because geoprocessing services can be used simultaneously by multiple authorized users and clients, they allow your organization to extend and automate its custom geoprocessing workflows.
Even when you are working with a web tool in your ArcGIS Enterprise portal, you can still access its underlying geoprocessing service or services using the ArcGIS REST API. This allows you to script and extend the geoprocessing workflow run by the service. You can use a geoprocessing service to do the following:
- List available tools and their input and output properties.
- Run a task synchronously.
- Submit a job to a task asynchronously.
- Get job details, including job status.
- Display results using a map service.
- Display results using a hosted feature service.
- Retrieve results for further processing by the client.
You can incorporate geoprocessing services into web GIS applications, whether you're using Esri Developer resources or any other environment capable of making REST API calls.
This topic provides an overview of the Esri client applications and resources that can use geoprocessing services published to ArcGIS Server.
ArcGIS Pro
Once a geoprocessing service has been published, you can work with it in ArcGIS Pro, where geoprocessing services can be used in the same way as built-in geoprocessing tools to run geoprocessing tasks.
There are advantages to using geoprocessing services in desktop GIS workflows: Instead of using your desktop machine's processing power to run geoprocessing tasks, you can use the more powerful server machines running the geoprocessing service. In addition, geoprocessing services and web tools often provide custom geoprocessing workflows and task chains to help accomplish specific GIS workflows.
You don't have to be the author or owner of a geoprocessing service or web tool to use it in a desktop GIS application. If you have the appropriate credentials to access the resource on the web, you can connect from ArcGIS Pro and use the service.
Use a geoprocessing service in ArcGIS Pro
By connecting from ArcGIS Pro to ArcGIS Enterprise, you can use the geoprocessing resources running on its servers.
To use a web tool that's been shared to your ArcGIS Enterprise portal, ensure that you've signed in and set it as your active portal.
To directly use the underlying geoprocessing service of a web tool, or to use a geoprocessing service published to a stand-alone server site, you can make a server connection under Servers in the Catalog pane.
Python scripts
You can write a Python script to run and use a geoprocessing service in multiple ways. The primary way to run a script is to use ArcPy, the Esri Python site package. ArcPy has built-in methods to connect to, run, and handle the result from the service.
Alternatively, using the ArcGIS Server Services Directory to access a geoprocessing service directly, you can use built-in Python modules to make REST calls using a JSON structure to transfer results. You must build a client from scratch with Python code use Python modules. The majority of scripts will connect to and use geoprocessing services through ArcPy.
For more information about authoring Python scripts in ArcGIS Pro, see Usage in Python scripts.
Web applications
There are several ways to make geoprocessing service capabilities available on the web in applications other than Map Viewer. While each client application that uses a geoprocessing service ultimately does so through the ArcGIS REST API, you don't necessarily need to know how to make programmatic REST requests. More advanced options are available with custom coding through the Esri Developer APIs and SDKs.
ArcGIS REST API
Any client capable of making REST API calls can invoke the ArcGIS REST API to query a geoprocessing service. Each programmatic request to the service prompts it to run its geoprocessing task or tasks and return a response to the client.
A number of data types can be input parameters when making a REST API request to a geoprocessing service. You can make requests in the following ways:
- To make a synchronous task request, use the execute operation. You must wait for the results to return before performing other operations.
- To make an asynchronous task request, use the submitJob operation. You can do other tasks while waiting for the results to return; you can also cancel a queued asynchronous job.