# MapServer WMS not configured properly?

This is related to another question I asked just recently:

Use OpenLayers WMSGetFeatureInfo on Mapserver Layer?

unicoletti indicated that he/she was able to use OpenLayer's WMS Layer declaration to generate and query MapServer WMS. However, when I attempt the same, I get a error response:

mapserv(): Web application error. Query mode needs a point, imgxy and mapxy are not set.

This error makes sense in that when I use OL's MapServer Layer declaration, the url string includes these options with values filled in. But using the WMS Layer declaration with standard WMS GetMap options, i.e. BBOX, WIDTH, HEIGHT, generates this error. The image is not correct either which I describe next.

Another symptom is that the entire extent of the data defined in the mapfile is displayed rather than what's indicated in the BBOX when just doing a standard WMS GetMap request via a URL rather than using OpenLayers.

So for example, here's the first part of my mapfile:

MAP
NAME "testgrib"
IMAGETYPE      PNG
EXTENT         -14000000 3000000 -7000000 7000000


And here's a GetMap request using standard WMS options:

http://localhost:8080/cgi-bin/mapserv?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&FORMAT=image%2Fpng&MODE=map&MAP=wxmap%2Fglmpvis.map&LAYERS=mosaic&SRS=EPSG%3A3857&TRANSPARENT=TRUE&STYLES=&BBOX=-13807095.590531,3308267.5857033,-12241665.251469,4482340.3400001&WIDTH=640&HEIGHT=480

As you can see, the BBOX extent values are different from those in the mapfile. But, MapServer returns an image with the extent values in the mapfile no matter what BBOX values are passed. I've changed the mapfile extent to match the BBOX values and sure enough, an image of only that area is returned.

Hence this leads me to believe we've missed something during our MapServer installation, some setting or configuration. I've checked to see that WMS was supported and received SUPPORTS=WMS_SERVER when making a GetCapabilities request as well as a -v on the MapServer executable.

I considered attaching the options to the query function that I can see are used to generate images using OL's MapServer Layer declaration to get around this issue. But, as we eventually want our customers to access our data through the WMS, solving that would seem to be the main goal here.

I've searched the web and MS docs for a possible setting/configuration, but nothing really stood out as being critical. I do have "wms_enable_request" "*" in the map file and, as indicated, I am receiving images from MapServer, albeit for the max extent of the data vs the viewing area. And I'm receiving a response back to the query, so this doesn't look like a cross domain/proxy issue. Also, this occurs with displaying an image for raster data as well as an image of point data. The only thing that works is to use OL's MapServer declaration to generate the images properly for the viewing area. But, that's not what we want for a long term solution with our customers accessing the data via WMS.

So, open to suggestions as to what we should either configure differently or what we might've missed to enable standard WMS in our MapServer.

Thanks!

-
Have you seen this document: mapserver.org/ogc/wms_server.html ? –  unicoletti Mar 4 '12 at 20:04