Skip To Content

Tutorial: Publishing and Consuming a WPS service

Complexity: BeginnerData Requirement: Use your own data Goal: Publish a WPS service to ArcGIS Server and consume it in a web browser.

The Open Geospatial Consortium, Inc. (OGC), Web Processing Service (WPS) specification is an international specification for serving and executing geospatial processing on the web. When a geoprocessing service is published with WPS capabilities, the data can be accessed by any client that supports WPS. If you're new to WPS and want to learn more about it before attempting this tutorial, see WPS services.

This tutorial walks you through the process of publishing a geoprocessing service to ArcGIS Server that can be accessed by WPS clients. To do this, you must prepare a tool in ArcGIS Desktop, run the tool and obtain a successful result, and publish the geoprocessing result with the WPS capability enabled.

Before beginning this tutorial

With ArcGIS Server 10.8.1 or later, you can publish a web tool or a geoprocessing service from ArcGIS Pro or ArcGIS Desktop. If your version of ArcGIS Server is 10.8 or earlier, you can only publish a WPS-enabled geoprocessing service from ArcGIS Desktop:

Publishing a WPS service from ArcGIS Pro

Before configuring a WPS service, you must publish your analysis to ArcGIS Server. If the server is federated, publish your analysis as a web tool. If your server is a single-machine deployment, publish it as a geoprocessing service. To publish as a web tool, see Quick tour of authoring and sharing a web tool. To publish as a geoprocessing service, see Quick tour of authoring and sharing a geoprocessing service. Once you have published a web tool or geoprocessing service, configure a WPS service using the following steps:

  1. Sign in to ArcGIS Server Manager
  2. On the default Services tab, locate and click the link of the your published service.
  3. On the Capabilities tab, check the WPS check box.

    After the WPS option is checked, you will see the properties of the WPS service. You can configure properties such as Name, Abstract, and Title.

Publishing a WPS Service in ArcGIS Desktop

Unlike publishing from ArcGIS Pro, you can only publish analysis as a web tool or geoprocessing service through a server connection. However, you can configure a WPS service during the publishing process in addition to configuring it in ArcGIS Server Manager after publishing. Detailed publishing steps are described below:

Prepare the geoprocessing tool in ArcGIS Desktop

A geoprocessing service contains one or more tasks. A task is similar to a geoprocessing tool in that it accepts parameters and returns results; it is a term that clients of ArcGIS Server use to describe routines that do work on a server and return results. For example, you can create a geoprocessing tool that delineates watersheds based on land-use and elevation data. This tool can then be published with the WPS capability enabled and consumed as a task in a WPS-compliant application on the web.

The topic Authoring geoprocessing tasks with ModelBuilder can guide you through the items you should consider when you create your geoprocessing tool.

Run the tool

Before publishing the tool, execute the tool first and obtain a successful geoprocessing result in the Results window. To do so, use the following steps:

  1. From the Catalog tree, double-click your geoprocessing tool.
  2. Enter appropriate parameter values and click OK to run the tool.

    When the tool executes successfully, the Results window appears.

Publish the result

After the tool successfully executes, you can publish your geoprocessing tool as a geoprocessing service. During this process, you'll enable the WPS capability, which will make your geoprocessing service (and subsequent tasks) OGC WPS compliant.

  1. Right-click your geoprocessing result and choose Share As > Geoprocessing Service.
  2. In the Share as Service window, choose Publish a service. Click Next.
  3. On the Publish a Service dialog box, click the Connect To ArcGIS Server check box Add ArcGIS Server to create a connection to the server.
  4. In the Add ArcGIS Server window, choose Publish GIS Services. Click Next.
  5. For the Server URL, type the URL of the ArcGIS Server site you want to connect to, for example, http://gisserver.domain.com:6080/arcgis.
  6. From the Server Type drop-down list, choose ArcGIS Server.

    During the publishing process, a service definition file is created and temporarily stored locally on disk. When the publishing process completes, the service definition is uploaded to the server and the local file is deleted. For the purposes of this tutorial, accept the default staging folder and continue.

  7. Enter your User Name and Password. Click Finish.
  8. In the Publish a Service window, enter a new name for the service. The name cannot be more than 120 characters long and may contain only alphanumeric characters and underscores. Click Next.

    By default, services are published to the root folder (root) of ArcGIS Server. Services can be organized into subfolders under the root folder.

    Choose the folder where you want to publish the service or create a folder to contain the service. Click Continue.
  9. The Service Editor appears. You'll use the Service Editor to choose what users can do with your geoprocessing service and take fine-grained control of how the server will expose your geoprocessing service. Click the Capabilities tab.
  10. By default, geoprocessing is enabled. Select WPS.
  11. In the left pane of the Service Editor, click WPS. Use this panel to choose how to configure the properties of your WPS service. By providing WPS service properties, clients can gain a better understanding of the service publisher.
    • The URL field displays the URL clients use to access the WPS service. The URL will be formatted as follows: http://gisserver.domain.com:6080/arcgis/services/folder/service/GPServer/WPSServer.
      Note:

      Copy and save the WPS service URL. You will need it to perform additional steps in this tutorial.

    • To configure a WPS service with system-generated capabilities files, use the default Enter service properties below option. The Name, Title, and OnlineResource fields are automatically populated and should not be modified. Optionally, you can populate additional properties using the fields in the list. For more information, see Available WPS service properties.
    • To configure a WPS service to use external capabilities files, choose Use external capabilities files. To use this option, you must have already created a WPS capabilities file.
    • Namespace and Prefix are unique properties that are used to differentiate your WPS processes from other WPS processes. These are populated automatically and should not be modified.
    Tip:

    For tips and best practices on how to set geoprocessing service properties using the Service Editor, see Geoprocessing service settings: General. For information about how to best configure your services for deployment, see Tune and configure services.

  12. Click the Analyze button Analyze. This will examine your result to see if it can be published as a WPS service to the server.
    Tip:

    To give yourself more viewing area when configuring your WPS service, click the Collapse button Collapse at the top of the Service Editor.

  13. Fix any errors in the Errors section Error of the Prepare window. This must be done before you can publish your result as a WPS service. Optionally, you can fix the warnings and informational messages to further improve the performance and appearance of your service. For more information about resolving these issues, see Analyzing your GIS resource.
    Note:

    You can register folders and geodatabases with your ArcGIS Server site, ensuring that the server can recognize and use your data. If you proceed with the following steps, any data referenced by your tool originating from an unregistered folder or geodatabase will be copied to the server at the time that you publish. This is a precautionary measure to ensure that the server can access all the data used by the service. For full instructions on registering a folder or geodatabase with your ArcGIS Server site, see Register your data with ArcGIS Server using ArcGIS Desktop or ArcGIS Pro.

  14. Optionally, in the Service Editor, click Preview Preview. This can give you a preview of how your tool dialog box will appear when viewed on the web.
  15. Once you've fixed the errors in your geoprocessing model, click Publish Publish.

Get and describe a WPS service

Once you have published a WPS service, it can be used in any client that supports WPS 1.0.0. A web browser is one of the simplest clients of a WPS service. You can request information through HTTP, and the responses or exceptions are returned through the browser.

Follow these steps to access WPS services through a web browser:

  1. Open a web browser.
  2. Perform the GetCapabilities and DescribeProcess requests as indicated in the following sections.

GetCapabilities

This request returns all metadata and processes available through the service in GML format. To use the GetCapabilities operation, copy and paste the WPS service URL into the address bar and add ?SERVICE=WPS&VERSION=1.0.0&REQUEST=GetCapabilities to the end of the URL.

URL example: https://gisserver.domain.com:6443/arcgis/services/my_wps/GPServer/WPSServer?SERVICE=WPS&VERSION=1.0.0&REQUEST=GetCapabilities

URL example: https://gisserver.domain.com/webadaptor//services/my_wps/GPServer/WPSServer?Service=WPS&Version=1.0.0&Request=GetCapabilities

DescribeProcess

The response to a DescribeProcess request contains detailed information for a particular process offering, which basically describes the unique identifier of the process and the identifier, type, and schema of each mandatory or optional input/output parameter for the process. This information is necessary for a WPS client to issue subsequent Execute requests to do the actual geospatial processing. To use the DescribeProcess operation, copy and paste the WPS service URL into the address bar and add ?SERVICE=WPS&VERSION=1.0.0&REQUEST=DescribeProcess to the end of the URL.

URL example: https://gisserver.domain.com:6443/arcgis/services/my_wps/GPServer/WPSServer?SERVICE=WPS&VERSION=1.0.0&REQUEST=DescribeProcess&Identifier=output_feature_layer

URL example: https://gisserver.domain.com/webadaptor/services/my_wps/GPServer/WPSServer?Service=WPS&Version=1.0.0&Request=DescribeProcess&Identifier=output_feature_layer

Execute a WPS service process

To perform geospatial processing on the web, you can send an Execute request to the WPS service through a WPS client. An Execute request usually carries either the value or reference of each input and output parameter of the WPS process and also specifies how the result of the process should be sent back by the WPS service. The response to an Execute request contains the embedded result of the spatial processing and can be configured to return the results of recent spatial processing jobs.

Execute operations are typically invoked through an HTTP POST request in the WPS client. The following is a sample Execute request sent to the URL example: https://gisserver.domain.com:6443/arcgis/services/my_wps/GPServer/WPSServer, or an equivalent URL example: https://gisserver.domain.com/webadaptor/services/my_wps/GPServer/WPSServer?Service=WPS&Version=1.0.0&Request=Execute&Identifier=SampleProcessId:

<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" service="WPS" version="1.0.0" language="en-US">
   <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">SampleProcessId</ows:Identifier>
   <wps:DataInputs>
      <wps:Input>
         <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">Input_String</ows:Identifier>
         <wps:Data>
            <wps:LiteralData dataType="xs:string">abcdefg</wps:LiteralData>
         </wps:Data>
      </wps:Input>
   </wps:DataInputs>
   <wps:ResponseForm>
      <wps:ResponseDocument storeExecuteResponse="true" lineage="true" status="false">
         <wps:Output schema="http://www.w3.org/TR/xmlschema-2/#string" asReference="false">
            <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">Output_String</ows:Identifier>
         </wps:Output>
      </wps:ResponseDocument>
   </wps:ResponseForm>
</wps:Execute>

For more information about WPS request operations and their parameters, see the OGC WPS 1.0.0 specification. Esri also maintains an Open Standards web page detailing its support for OGC services in ArcGIS.