The Open Geospatial Consortium, Inc. (OGC), Web Map Service (WMS) specification is an international specification for serving and consuming dynamic maps on the Web. You can use ArcGIS Server to create a WMS service. You do this by enabling the WMS capability on a map or image service.
WMS services are useful if you want to make your maps available online in an open, recognized way across different platforms and clients. Any client built to support the WMS specification can view and work with your service. Four versions of the WMS specification have been published so far. They are v1.0.0, v1.1.0, v1.1.1, and v1.3.0 (most recent).
Client applications work with a WMS service by appending parameters to the service's URL. WMS services published with ArcGIS Server support the following operations:
- Requesting metadata about the service (GetCapabilities)
- Requesting a map image (GetMap)
- Requesting information about features in the map (GetFeatureInfo [optional])
- Requesting user-defined styles (GetStyles)
- Requesting legend symbols (GetLegendGraphic)
It is not necessary for a WMS service to support all the operations, but it must support at least the GetCapabilities and GetMap operations to be a Basic WMS and support the optional GetFeatureInfo operation to be a Queryable WMS. Both the GetStyles and GetLegendGraphic operations are only applicable in a Styled Layer Descriptor (SLD) WMS service.
The maps returned by a WMS service are images only (with the exception of SVG). They do not contain actual data. To expose your data as vector features through OGC specifications, publish a WFS service instead. To expose data as raster layers, publish a WCS service. You can publish both WFS and WCS services using ArcGIS Server.
Publishing a WMS service in ArcGIS Server
There are two ways you can publish a WMS service using ArcGIS Server:
- Publish a map service with the WMS capability enabled. To publish a map service, you first need to create a map document.
- Publish an image service with the WMS capability enabled. To publish an image service, you need to have either a raster dataset, a mosaic dataset, or a layer file referencing a raster dataset or mosaic dataset.
You can use either ArcGIS Server Manager or ArcCatalog to publish the service. If you need help with this step, see About publishing GIS resources to the server.
When you publish your map or image service, you should enable the WMS capability by checking the check box in the Capabilities list.
- The number of layers in the map directly affects the amount of time it takes to initially create the WMS service or start it after it has been stopped. You may be able to reduce the startup time by removing or consolidating layers in the service.
- WMS services take advantage of a map cache if one is available. The map cache is only used when requesting the original projection, layer order, and layer visibility of the service. The cached tiles are resampled to fit the scale requested by the client, which can take some processing time and reduce the image quality. You'll see the most benefit using a cache if your WMS service has many layers or sophisticated symbology that would otherwise take a long time to draw dynamically. If you have just a few layers and simple symbology, you may get better performance without a cache.
- Viewing a WMS service from a cached-on-demand map service will create tiles in the cache if the user navigates to uncached areas.
- After you publish the service, you can set further properties for the WMS service on the Capabilities tab of the Service Properties dialog box.
For a detailed walk-through of the process of creating a WMS service, see Tutorial: Publishing a WMS service.
Configuring WMS service properties
A WMS service's properties are reflected in its capabilities files so that whoever consumes the service can have a better understanding of the service publisher. When publishing a WMS service with system-generated capabilities files (the default), it is recommended that you populate the WMS service properties except for Name, Title, and OnlineResource. The Name and Title service properties are already filled in with WMS and the name of the map service or image service, and OnlineResource is already filled in with the URL of the WMS service. In most cases, you should not change those three properties.
To populate or modify WMS service properties, do the following:
- Stop the parent map or image service.
- Open the Service Properties and click the Capabilities tab.
- In the list of capabilities, find WMS. Make sure the check box is checked, then click the letters WMS (be careful not to uncheck the box). You'll see some properties appear.
- Select Enter service properties below. This means your service is going to use a system-generated capabilities file.
- Modify the service properties appropriately.
- Save and restart the parent map or image service.
The OnlineResource field is necessary for a WMS client to communicate correctly with your WMS service. Usually, its value is a URL, and it should show up in the Web Access box of the Capabilities tab.
Configuring the SLD path or URL
SLDs allow you to publish multiple styles for each WMS layer. If you are binding an SLD file to the current WMS service, you need to set the SLD path or URL property to the URL, UNC path, or physical location of an SLD XML file. Learn more about working with SLDs.
The UNC path and physical location must be accessible by the SOC account for ArcGIS Server to properly read the SLD XML file.
Configuring the ListSupportedCRS parameter
The ListSupportedCRS parameter can be used to add additional spatial reference systems (such as EPSG:4267) to WMS services. By default, WMS services only list two spatial reference systems; EPSG:4326 (or CSR:84 for WMS 1.3.0) and the spatial reference of the map service that WMS is enabled on. By using the ListSupportedCRS parameter, you can advertise more reprojection options to WMS clients by specifying additional spatial references.
The ListSupportedCRS parameter is not listed as a service property when configuring WMS services in ArcCatalog or ArcGIS Server Manager. To add the ListSupportedCRS parameter to a WMS service, you must edit the service configuration file (.cfg) of the map service on which you enabled WMS.
Edit the configuration file:
- Stop the ArcGIS Server Object Manager (SOM) process
- Open the service configuration (.cfg) file of the map service in a text editor
- Locate the section specific to WMS
- Add the ListSupportedCRS parameter within the <Properties> element:
... <Extension> <TypeName>WMSServer</TypeName> <Enabled>true</Enabled> <Properties> <!-- other properties and metadata items --> <CustomGetCapabilities>false</CustomGetCapabilities> <ListSupportedCRS>EPSG:4267</ListSupportedCRS> </Properties> <Info> <WebEnabled>true</WebEnabled> <WebCapabilities></WebCapabilities> </Info> </Extension> ...
- Save your edits and close the service configuration (.cfg) file
- Restart the ArcGIS Server Object Manager (SOM) process
To list multiple spatial reference systems within the ListSupportedCRS parameter, separate the spatial reference systems with a comma (,). For example:
When configuring the ListSupportedCRS parameter, you must specify the EPSG namespace (e.g. EPSG) and the EPSG ID (e.g. 4267) separated by a colon (:), or the spatial reference will be ignored by the server.
Special characters in service properties
The following characters cannot be included in any of the service properties: &, <, >, ", '. If you need to use one of these characters, you must substitute the appropriate escape sequence from the table below:
Representing layer names
When modifying the service properties, you can check a check box to Use layer names from the map document. When you do this, the layer names will be represented with the same strings that are used in the map document's table of contents. The default unchecked box means the layers will be represented with zero-based integers, indicating their position in the table of contents from the top down.
To use layer names from the map document, all the layer names in the map must be unique. The layer names must not contain any of the characters &, <, >, ", or '.
Securing WMS services
The security for an ArcGIS Server WMS service is managed by controlling the security of its parent map or image service. If a particular role, for example, Planners, is denied access to a map, then Planners will not be able to access the map no matter whether they try to consume it through SOAP, representational state transfer (REST), or OGC (for example, WMS) interfaces. ArcGIS Server supports a number of different authentication schemes including HTTP-based authentication (Basic and Digest), Integrated Windows Authentication, and ArcGIS Server managed token-based authentication.
HTTP authentication and Integrated Windows Authentication
Services that are expected to be accessed via WMS interfaces should be secured using HTTP Basic, HTTP Digest, or Integrated Windows Authentication. Most WMS clients (both non-ESRI and ESRI clients) will understand and work with these widespread standard authentication schemes.
ArcGIS Server managed token-based authentication
Consuming WMS services
To connect to a WMS service, you need to know the URL. WMS services published with ArcGIS Server have this URL format:
http://<Web server machine name>/<ArcGIS Server instance name>/services/<folder name (if applicable)>/<service name>/<service type (can be MapServer or ImageServer)>/WMSServer?
Remember that the WMS capability is available for both map services and image services. This is why there are two options for the service type.
For example, if you have a folder Japan containing the map service Tokyo, running on myServer with the default instance arcgis, the URL of your WMS service would look like this:
If you have an image service IdahoImages running on myServer with the instance name of PublicLands, your URL for the WMS service would look like this:
Common WMS clients
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 may support several operations: GetCapabilities, GetMap, GetFeatureInfo, GetStyles, and GetLegendGraphic. Through URL parameters, a client can use these operations to obtain metadata, maps, feature information, symbologies, and legend symbols from the WMS service. These operations and parameters are detailed in the OGC WMS specifications.
ESRI WMS clients include ArcGIS Desktop (ArcCatalog and ArcMap), ArcGIS Explorer, ArcGIS Server Web Application Developer Framework (ADF) for .NET, ArcGIS Server Web ADF for Java, and ESRI ArcGIS Server Geoportal Map Viewer.
Viewing legend information for a WMS service
WMS services can be configured to return information about the symbology of layers in the service. Clients can use this information to construct a legend. By default, WMS services that you publish with ArcGIS Server are enabled to return legend information. You can change this through the WMS service's capabilities files.
Both ArcMap and the Web Mapping Application that you build with Manager can display legend information for WMS layers.
- In ArcMap, right-click the layer in the table of contents and click Add WMS Legend to Map. The legend information appears on the map.
- In the Web Mapping Application, you can see legend swatches for individual layers by expanding the layers in the table of contents.