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 publish a WMS service to ArcGIS Server by enabling the WMS capability when you publish a map or image service in ArcGIS Desktop.
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 to 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 map images returned by a WMS service do not contain actual data, although attribute requests can be made through the GetFeatureInfo operation. 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 learn more about WMS services at the Open Geospatial Consortium website.
Publishing a WMS service
There are two ways you can publish a WMS service:
- 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.
When you publish your map or image service, make sure you enable the WMS capability by checking the WMS check box in the Capabilities tab of the Service Editor. For a detailed walk-through of the process of creating a WMS service, see Tutorial: Publishing a WMS service.
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 service cache if one is available. The map service 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 uncomplicated symbology, you may get better performance without a cache.
If your image service is configured with multiple raster function templates, these raster function templates will be accessible through subLayers in WMS. If your image service is based on a multiple dimensional mosaic dataset, the variables defined in the multidimensional mosaic dataset will be accessible through subLayers in WMS.
WMS services can only use map service caches; image service caches are not supported.
Viewing a WMS service from a cached-on-demand map service will create tiles in the cache if the user navigates to uncached areas.
If your WMS originates from an ArcGIS Server image service based on a mosaic dataset, the client can issue queries for specific rasters in the dataset. In this situation, the WMS GetMap request has an additional parameter available, IMAGES—for example, setting IMAGES=1,2 would request the images with object IDs 1 and 2 from the image service catalog table.
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. For information about each WMS service property you can set, see Available WMS service properties. Additionally, the following topics include instructions on how to get to the location where you can set WMS service properties:
Configuring WMS service supported operations
You can control the allowed WMS service operations in Manager and ArcGIS Desktop. For example, if there is a requirement to restrict access to individual feature information, uncheck the GetFeatureInfo option. Any requests to access feature information would be denied.
By default, all operations are enabled on the service. Available operations are:
- GetCapabilities—Returns the capabilities information to the client as a response to GetCapabilities request.
- GetFeatureInfo—Returns features to the client as a response to GetFeatureInfo request.
- GetLegendGraphic—Returns a legend image to the client as a response to GetLegendGraphic request.
- GetMap—Returns a map image to the client as a response to GetMap request.
- GetSchemaExtension—Returns the schema to the client as a response to GetSchemaExtension request.
- GetStyles—Returns available styles information to the client as a response to GetStyles request.
To be fully compliant with OGC WMS, enable (at a minimum) the GetCapabilities and GetMap operations.
Setting WMS properties using an external capabilities file
Another way to define the metadata is by using an external capabilities file. This allows you to include additional projections for your feature types other than the defaults. The defaults include the coordinate system of the layer or feature class and WGS84 (EPSG 4326). See Using external capabilities files with WMS services for more information.
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, 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.
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 Esri and non-Esri clients) will understand and work with these widespread standard authentication schemes.
ArcGIS Server managed token-based authentication
Although not recommended, a WMS service can still be secured using ArcGIS Server managed token-based authentication by using this type of authentication on its parent map or image service. To make raw requests to WMS services protected by a token, you can get a valid token from the token service and append the token string as an extra parameter to the requests you send out. In other words, requests to a token-secured WMS service must use the following format:
http://<WMS_service_url>?<standard WMS parameters>&token=<valid_tokenString>
Consuming WMS services
To connect to a WMS service, you need to know the URL. WMS services published to ArcGIS Server have this URL format:
http://gisserver.domain.com:6080/arcgis/services/folder/service/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 gisserver with the port number 6080, the URL of your WMS service would look like this:
If you have an image service IdahoImages running on myServer with the port number 6080, 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 specification.
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 to ArcGIS Server are enabled to return legend information. You can disable this through the Use layer names from the map document property. For more information, see Available WMS service properties.
You can display legend information for WMS layers in ArcMap by right-clicking the layer in the table of contents and selecting Add WMS Legend to Map.