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.
After configuring the service properties and task settings in the Service Editor, you're ready to publish the service to the server.
- Click the Publish button. A progress dialog box will appear to show the status of publishing.
- 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.
- 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 (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.
- If you did not enable Start service immediately, follow the instructions in Starting, stopping, and restarting services to start the service.
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 and publish again by clicking the Publish button. See Analyzing a geoprocessing service for more information on the Prepare window and errors.
What happens during publishing
- 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.
- 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
- 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.
- 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.
- 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.
- 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.