I tried to connect WMS from my MapServer 7.0.4 in QGIS 2.18.3 (QGIS 2.10.1 too) but it failed with error:
Map request error (Status: 200; Response: <HTML>
<HEAD><TITLE>MapServer Message</TITLE></HEAD>
<!-- MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
<BODY BGCOLOR="#FFFFFF">
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed.
</BODY></HTML>; Content-Type: text/html; URL:http://192.168.0.127/mapserver/scripts/mapserv.exe?map=D:\MapServer\map\wmstest.map?&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-422441,-1246470,-419074,-1245430&SRS=EPSG:2065&WIDTH=1302&HEIGHT=403&LAYERS=ulice&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE)
I think there is a problem with "?" in a request GetMap. A correct one should be:
...wmstest.map&SERVICE=WMS....
and QGIS make a link:
...wmstest.map**?**&SERVICE=WMS....
Here is my link for connecting WMS (not accessible from internet):
http://192.168.0.127/mapserver/scripts/mapserv.exe?map=D:\MapServer\map\wmstest.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
Can someone explain me?
my map file contents:
"wms_onlineresource" "http://192.168.0.127/mapserver/scripts/mapserv.exe?map=D:\MapServer\map\wmstest.map?"
I tried it without "?" at the end, but it didn't work. A request GetMap works fine in my browser (without that "?").
"wms_onlineresource" "http://192.168.0.127/mapserver/scripts/mapserv.exe?map=D:\MapServer\map\wmstest.map"
and use the same URL for connecting your server. A workaround that you should not need to use is to check theIgnore GetMap/GetTile URI reported in capabilities
.?
is correct it separates the endpoint of the service from the query parameters, such asmap=&
,request=GetMap&
, ...