Skip To Content

Publishing a geoprocessing service

See A quick tour of publishing a geoprocessing service for information on opening and using the Share As Service wizard and the Service Editor to configure a geoprocessing service and its tasks.

Publishing

After configuring the service properties and task settings in the Service Editor, you're ready to publish the service to the server.

  1. Click the PublishPublish button. A progress dialog box will appear to show the status of publishing.
  2. If there are any errors in your service, the Prepare window will open and publishing will be stopped. You'll need to fix any errors Error and publish again by clicking the PublishPublish button. See Analyzing a geoprocessing service for more information on the Prepare window and errors.

  3. The Copying Data to Server dialog box will open if your service requires that data be copied to the server. You should review the list of datasets; it could be that you expect one or more of the datasets to be in the server's data store. Click OK to continue with publishing. Click Cancel to return to the Service Editor.
    Note:

    A registered database connection must use either an .sde or an .odc file. Data from a SQL Express database, created through the Database Servers node in the Catalog window is only supported when an actual .sde connection is made and used to reference both the data and is the item registered with the data store.

    Learn more about managing the data store

  4. If you clicked OK on the Copying Data to Server dialog box, publishing begins. When publishing finishes, click OK on the Succeeded message dialog box.

    In some cases, a Failed to create service definition dialog box may appear. Typically, this error is due to tool parameters referencing data that no longer exists. Try the following:

    • In the Results window, right-click the results for which you are creating the service and choose Open. This will open the tool dialog box. If there are any errors Error (typically, these will be for data that doesn't exist), fix them and rerun the tool. If the tool executes successfully, publish the corresponding result.
    • In the Results window, there will be a result for the execution of the Stage Service tool. Stage Service is executed whenever you publish a service. Expand the Stage Service result, then expand Messages. The messages will give you specifics about why your result could not be published.

    If you enabled Start service immediately in the General settings of the Service Editor, your service is now running on the server and can be accessed by users and clients on your network.

What happens during publishing

Dive-in:

The content below contains behind-the-scene details about publishing.

  1. A draft service definition file (.sddraft) is created and saved to your staging folder. (You can discover the location of your staging folder by right-clicking a publisher or administrator server connection and choosing Properties.) This service definition draft contains all the custom tools (model and script tools you create) that define the tasks.
  2. The Stage Service tool is run to create a service definition file (.sd). During execution of Stage Service, all tools within the draft service file are scanned to create a list of all input and project data paths and database connections. These paths and database connections are compared against the server's data store. Any data whose paths or connections are not found in the data store is copied to the staging folder. If the data to be copied is from one of the sources listed below, the data is converted to file geodatabase data when copied. This is due to the original data not being supported on server platforms, or because it resides in an enterprise database that the server cannot connect to (that is, no connection found in the data store):
    • Enterprise geodatabase data
    • Personal geodatabase (.mdb) data
    • ArcInfo Workstation and PC coverage data
    • Tables based on Excel spreadsheets
    • Tables based on OLEDB connections
    Note:

    If you are using one of the following data types and they match an entry in the server's data store you will not be able to continue the publishing process. These data types are not supported on server platforms.

    • Personal geodatabase (.mdb) data
    • Tables based on Excel spreadsheets
    In addition, the custom tools within the draft service are scanned to find the tools they use; if any of these are custom tools, they are also copied to the staging folder, and scanning continues until all referenced custom tools are copied.
  3. The Stage Service tool creates a service definition file (.sd). This file contains all the tools from the draft service and all data and tools that were copied to the staging folder.
  4. The input draft service definition is deleted. Since Stage Service is a geoprocessing tool, you'll see the result of the tool's execution in the Results window.
  5. The Upload Service Definition tool is executed to upload the service definition file to the server. Since Upload Service Definition is a geoprocessing tool, you'll see the result of the tool's execution in the Results window.
  6. Once Upload Service Definition has transferred the service definition to the server, the server extracts the contents of the service definition file to the server's arcgisinput directory. Paths to the input data inside any model or script tools are changed at this time. These paths will either be resourced to the directory on the server (if the data was copied) or will be sourced to match the entry in the data store.

Related topics