WMS services

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 consume WMS services in applications using ArcGIS Runtime SDK for WPF.

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 uniform resource locator (URL). WMS services can support the following operations:

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 scalable vector graphics [SVG]). They do not contain actual data.

You can learn more about WMS services at the Open Geospatial Consortium website. Esri also maintains a Standards and Interoperability web page detailing its support for OGC services in ArcGIS.

Adding a WMS service

You can declare WMS services in Extensible Application Markup Language (XAML). They should be inserted inside a Map control element below any base layers. If you have not already done so, create a WPF application with a map (see Creating a map for details).

NoteNote:

The code in this topic requires a reference to the ESRI.ArcGIS.Client assembly. The XAML of the Window (for example, MainWindow.xaml) needs to have the following Extensible Markup Language (XML) namespace declaration:

xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
  1. In the Map element, declare a WmsLayer with an ID of OtherWMSLayer as shown in the following code sample:
    <esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >
      <esri:Map.Layers>
        <esri:WmsLayer ID="OtherWMSLayer" />
      </esri:Map.Layers>
    </esri:Map>
    
  2. To connect to a WMS service, you need to know the URL. WMS services published to ArcGIS for Server have this URL format:

    http://<server name>:<port number>/arcgis/services/<folder name (if applicable)>/<service name>/<service type (can be MapServer or ImageServer)>/WMSServer?

    Remember, 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 port number 6080, the URL of your WMS service would look like this:

    http://myServer:6080/arcgis/services/Japan/Tokyo/MapServer/WMSServer?

    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:

    http://myServer:6080/arcgis/services/IdahoImages/ImageServer/WMSServer?

    Provide the URL of the WMS service as shown in the following code sample:
    <esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >
      <esri:Map.Layers>
        <esri:WmsLayer ID="OtherWMSLayer"                      
                               Url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi"/>
      </esri:Map.Layers>
    </esri:Map>
    
  3. Provide the name of the layers within the service that you want to display
    <esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >
      <esri:Map.Layers>
        <esri:WmsLayer ID="OtherWMSLayer"                      
                               Url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi"                   
                               Layers="nexrad-n0r"/>
        </esri:Map.Layers>
    </esri:Map>
    
1/27/2015