[mapserver-users] WMS request fails when spaces are encoded as plus symbol in query part of URL

Moen, Paul T. pmoen at nd.gov
Tue Aug 19 14:56:32 PDT 2014


Hi all,

We are consuming WMS services hosted by ESRI ArcGIS Server 10.0.  The server was upgraded to ArcGIS Server 10.2.2 and we no longer can access layer names with spaces.

This is the server’s capabilities.
http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?request=GetCapabilities&service=WMS

This is the layer I am using.

LAYER
# DEBUG 5
CONNECTIONTYPE WMS
CONNECTION "http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?"
METADATA
"wms_name" "Topomap DRG 250k"
"wms_format" "image/png"
"wms_server_version" "1.1.1"
"wms_srs" "EPSG:2266"
END
TYPE RASTER
STATUS OFF
NAME "USGS DRG 250k Topo Maps"
END

Mapserver encodes this request as follows.  Notice that the layer name, which is ‘Topomap DRG 250k’, is encoded with the spaces becoming the ‘+’ character.

http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap+DRG+250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE

This returns the error in an image that says “Parameter ‘layers’ contains unacceptable layer names.”

When I replace the + in the layer name with %20, LAYERS=Topomap+DRG+250k become LAYERS=Topomap%20DRG%20250k and the request becomes the following.

http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap%20DRG%20250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE

That request works.  Obviously, ESRI is no longer decoding + as a space and therefore does not recognize the layer name with spaces.

Is there any way I can have mapserver encode all characters using percent-encoding, or at least encode spaces as %20 instead of a + character.

Thanks,

Paul Moen
pmoen at nd.gov<mailto:pmoen at nd.gov>
701-328-2434

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140819/61b12a87/attachment.html>


More information about the mapserver-users mailing list