Tutorial: Publishing a map service
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.
- Open your map document in ArcMap and choose File > Share As > Service from the main menu.
- In the Share as Service window, choose Publish a service. Click Next.
- In the Publish a Service dialog box, click Connect to ArcGIS Server to create a new connection to the server.
- In the Add ArcGIS Server window, choose Publish GIS Services. Click Next.
- 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.
- 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.
- If your server administrator has enabled security for your site, enter your User Name and Password. Click Finish.
- 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.
- 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.
- 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.
- 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.
- Click 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 button at the top of the Service Editor.
- Fix any Errors 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.
- Optionally, in the Service Editor, click 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.
- Once you've fixed the errors in your map document, click 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.
- 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.
- 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.
- 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.
- 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.
- Optionally, save the web map.
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, you can create a customized web mapping application using the ArcGIS.com application templates. These templates can be deployed on your organization's web server. For more information, see the Sharing content section of the ArcGIS.com Help.
- The ArcGIS Viewer for Flex and ArcGIS Viewer for Silverlight are configurable web applications that support web mapping. Without programming, you can fully customize these applications to work with your map service and deploy them on your organization's web server.
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.