Skip To Content

Tutorial: Publishing a map service

In this topic
Complexity: BeginnerData Requirement: Use your own dataGoal: Publish a map service to ArcGIS Server and consume it over the web using the ArcGIS.com map viewer.

This tutorial gives you the steps for publishing a map service to ArcGIS Server using ArcMap. A map service is the way that you make maps, features, and attribute data available to the web using ArcGIS. If you're new to map services and want to learn more about them before attempting this tutorial, see map services.

Before beginning this tutorial

If you've just installed ArcGIS Server, you need to complete some preparatory steps before you can connect to the server and publish services:

Publish your map as a service

To publish your map as a service, follow these steps.

  1. Open your map document in ArcMap and choose File > Share As > Service from the main menu.
  2. In the Share as Service window, choose Publish a service. Click Next.
  3. In the Publish a Service dialog box, click Connect to ArcGIS Server Add ArcGIS Server to create a new 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.
  7. 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.
  8. If your server administrator has enabled security for your site, enter your User Name and Password. Click Finish.
  9. Optionally, 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.
  10. 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 new folder to contain the service. Click Continue.
  11. The Service Editor displays. You'll use the Service Editor to choose what users can do with your map service and take fine-grained control of how the server will expose your service. Click the Capabilities tab.
  12. By default, mapping and KML are enabled. Click Mapping and review the following properties:
    • URL—This is the URL clients use to access the map service. The URL will be formatted as follows: http://gisserver.domain.com:6080/arcgis/services/folder/service/MapServer.
    • Data—Selecting this option allows client applications to perform attribute searches on the features in your map service.
    • Map—Selecting this option allows client applications to view the map layers in your map service.
    • Query—Selecting this option allows client applications to query the features in your map service.
  13. Click Analyze Analyze. This examines your map document to see if it can be published to the server.
    Tip:

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

  14. Fix any Errors Error in the Prepare window; this must be done before you can publish. Optionally, you can fix the warnings and informational messages to further improve the performance and appearance of your map 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, thus ensuring that the server can recognize and use your data. If you proceed with the following steps, any data referenced by your map document 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 Registering your data with ArcGIS Server using ArcGIS for Desktop.

  15. Optionally, in the Service Editor, click Preview Preview. This can give you an idea of how your map will look when viewed on the web. See Previewing your map for more information.
  16. Once you've fixed the errors in your map document, click Publish Publish.

Your map service is published to ArcGIS Server. When the publishing process completes, you are ready to consume your map service in a web application.

Consume the map service in a web application

In this section of the tutorial, you'll use the ArcGIS.com map viewer to view and interact with your map service over the web. The map viewer is hosted on ArcGIS.com and is deployable directly through the ArcGIS Server Services Directory. It does not require any configuration or programming work to get the map viewer up and running.

To get started, follow these steps.

  1. Open a web browser and navigate to the ArcGIS Server Services Directory. Typically, this is located at http://gisserver.domain.com:6080/arcgis/rest/services. You can also access the Services Directory by opening the shortcut installed with ArcGIS Server.
  2. In the services list, click the name of your map service. Typically, this is displayed as <map service name> (MapServer). If you don't see your map service, it may be located within one of the folders listed in the Services Directory.
  3. In the page describing your map service, click View In: ArcGIS.com Map. A new window (or tab) opens, displaying the ArcGIS.com map viewer. The map viewer display is zoomed to the extent of your map service.
  4. Take some time to pan and zoom around your map service. You can also switch the basemap layer to more appropriately complement the context of your map.
  5. Optionally, save the web map.

Further reading

Now that you've successfully tested your map service using the ArcGIS.com map viewer, you may want to consider how you can use and share your map in other ArcGIS clients. For example:

  • In ArcGIS Online and Portal for ArcGIS, you can create a customized web mapping application using the application templates. These templates can be deployed on your organization's web server.
  • The ArcGIS API for JavaScript offers the most advanced web mapping capabilities and customization options. If you're comfortable programming using this API, you can create a rich experience for your users on the web by utilizing a map service identical to the one you created in this tutorial.

By exploring one or all of the ArcGIS clients listed above, you give yourself additional options that can help you tailor your web mapping scenario for a specific purpose, goal, or organizational strategy.