An OGC Web Map Service (WMS) produces maps of spatially referenced data dynamically from geographic information. This international standard defines a "map" to be a portrayal of geographic information as a digital image file suitable for display on a computer screen.
WMS service interfaces define three operations:
- Returns service-level metadata (GetCapabilities)
- Returns a map whose geographic and dimensional parameters are well-defined (GetMap)
- Returns information about particular features shown on a map (GetFeatureInfo, optional)
Preparing the map document
Publishing any GIS service requires you to first create the GIS resource, such as a map, then publish the resource as a service. A successfully published service can be consumed by client applications that support the service type. To follow this pattern for a WMS service, you need to first create the map document that you want to serve, then publish the map document as a WMS service using either ArcCatalog or ArcGIS Server Manager. The service can then be consumed by any client that supports the OGC WMS specification.
Use ArcGIS Desktop's ArcMap application to create the map document that you want to serve. The map document and all of the data it references must be accessible to each server object container machine in your ArcGIS Server configuration. Additionally, the ArcGIS Server Object Container account must have the appropriate permissions to the data folder.
When preparing a map document for publication as a WMS service, keep in mind that people who view the service will not be able to change the layer order, symbology, scale-dependency, or transparency levels that you set. You should author your map in a way that all users can interpret without having to adjust these properties.
WMS services created with ArcGIS Server only support their native spatial reference system and WGS84. Given that ArcGIS Server supports thousands of predefined spatial reference systems, these spatial reference systems can be added into a WMS service and advertised to WMS clients by using external WMS capabilities files. (see the subsection "Publishing a WMS service with external capabilities files" below for adding additional spatial reference systems).
Publishing the map document as a WMS service
To publish the map document as a WMS service, you will need to edit WMS properties in "Capabilities" tab of a GIS Map Service Properties through ArcCatalog. There are two ways to publish a map document as a WMS service in the perspective of how WMS capabilities files are generated. These are "WMS service with system generated capabilities files" and "WMS service with external capabilities files"
Publishing a WMS service with system generated capabilities files
- Start ArcCatalog.
- Open the "ArcGIS Server – Map Service Properties" dialog. (You can access this configuration dialog by right-clicking an existing map service or creating a new map service)
- Click the Capabilities tab.
- Click WMS in the capabilities list and check the checkbox.
- In the Properties section of Capabilities tab, select "Enter service properties below" and you will see a table where you can input WMS service level metadata.
- You must at provide a Name and a Title for your WMS service, and you must fill in the OnlineResource with the URL of this WMS service which is: http://<server name>:8399/<instance name>/services/<folder name (if applicable)>/<map name>/mapserver/wmsserver
- Populate other service level meta-data as needed.
- Click Apply. Then click OK to apply the change.
Publishing a WMS service with external capabilities files
Publishing using external capabilities aims at users who are familiar with OGC WMS specification and WMS capabilities files syntax. So they will have the maximum flexibility to customize their WMS services. With external capabilities files you can:
- Add service-level metadata information to WMS capabilities files
- Add layer-level metadata information to WMS capabilities files
- Add additional predefined spatial reference system from ArcGIS Server's predefined projection list
- Customize the legend information for each layer in the WMS service
To publish a WMS service with external capabilities files:
- Start ArcCatalog
- Open the "ArcGIS Server – Map Service Properties" dialog (You can access this configuration dialog by right-clicking an existing map service or creating a new map service)
- Click the Capabilities tab.
- Click WMS in the capabilities list and check the checkbox
- In the Properties section, select "Use external capabilities files" and you will see a input text where you can specify the URL location and prefix of capabilities files of your WMS service.
-
To use external capabilities files for your WMS services, you must have at least one WMS capabilities file ready. If you want your WMS service to support different versions of WMS protocol—for example, 1.0.0, 1.1.0, or 1.1.1—you must have one capabilities file for each version of WMS you want to support.
Note: External capabilities files are just XML files. You can find their definition in the WMS DTD/schema at http://schemas.opengis.net/wms/. You could create external capabilities files from scratch by following the OGC WMS specification and the WMS DTD/schema, but the best and most common workflow is to use system generated capabilities files as templates and modify them accordingly. To get system generated capabilities files, you need to publish a WMS service with system generated capabilities files first and save the XML responses of a WMS GetCapabilities request as XML files.
- Once you created all necessary capabilities file, name them with a common prefix (for example, "capabilities") plus a unique version number (for example, "capabilities100", "capabilities110", "capabilities111")
- Place all your capabilities files under a folder which is accessible from a URL.
- Input the URL of the folder where you place all your capabilities files plus the common prefix you use for them in "Specify the location prefix" input text box
- Click Apply. Then click OK to apply the change.
This task can also be accomplished from within Manager iteself. in Manager, locate the service in the Services list on the Services page and click the Edit icon next to it. Select the Capbilities link on the left side of the page and select the WMS caption. The properties to set will be available on the page.
Note: By using external capabilities files for your WMS service, you must be responsible for validating your capabilities files against DTD or XML schema from OGC and all the synchronization between your capabilities files and the map document based-on which WMS service is published.
Publishing a WMS service in ArcGIS Server Manager
To publish a map document as a WMS service, you can use the Publish GIS resource... option in ArcGIS Server Manager.
- Start ArcGIS Server Manager
- Click the Services tab.
- Click Publish GIS Resource.
- Set the resource by browsing to the location of the map document you want to publish.
- Choose whether to publish to an existing folder or a new folder.
- Check the box next to the WMS service capability.
- Click Publish.
After creating the service, you can view and configure its advanced properties at any time in ArcGIS Server Manager. When configuring advanced properties, remember that WMS Services should always be pooled.
Consuming the WMS service
To connect to a WMS service, you need to know the URL. When you use ArcGIS Server to publish a WMS service, its URL takes this format:
http://<server name>:8399/<instance name>/services/<folder name (if applicable)>/<map name>/mapserver/wmsserver?
For example, if you had a folder Japan which contained the service Tokyo, running on a machine named myServer with the default instance name of "arcgis", the URL of your WMS service would look like this:
http://myServer:8399/arcgis/services/Japan/Tokyo/mapserver/wmsserver?
You can see a list of all of the WMS services running on your server and their URLs in ArcGIS Server Manager. See Viewing WMS services for more information.
Types of clients for WMS services
A Web browser is the simplest client of a WMS service. WMS requests can be issued through HTTP, and the responses or exceptions are returned through the browser. WMS services support three operations: GetCapabilities, GetMap, and GetFeatureInfo. Through URL parameters, a client can use these operations to obtain metadata, maps, and feature information from the WMS service. These operations and parameters are detailed in the OGC WMS specifications.
ArcCatalog and ArcMap can also act as clients for WMS services. For help on using WMS services in ArcMap, see Adding a WMS service layer to ArcMap in the ArcGIS Desktop Help.
If you're developing applications with the Web ADF, you can connect to WMS services using the objects located in the com.esri.adf.web.wms.data package. For information on how to use this library, see the Developer Help.