[mapserver-users] msWMSLoadGetMapParams(): WMS server error.

Jason M. Amador jamador at sonomatech.com
Wed Nov 4 17:08:36 PST 2009


Hi,

I am trying to make a WMS GetMap request in C# using the OWSRequest object but I am getting the following error.


<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>

<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">

<ServiceExceptionReport version="1.1.1">

<ServiceException code="LayerNotDefined">

msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter.

</ServiceException>

</ServiceExceptionReport>

I can successfully make WMS GetCapabilities and GetMap requests through the browser directly.  I also have no problem making a WMS GetCapabilities request in C# by using the OWSRequest object.  It's just when I do a GetMap request that I get the above error.

My map file is below.

MAP
  NAME            CensusTract
  IMAGETYPE      JPEG
  EXTENT         -125.00 20.00 -65.00 50.00
  SIZE           400 300
  SHAPEPATH       "C:/Inetpub/wwwroot/cgi-bin/ms4w/apps/fhwa/data/CensusTract2005"
  IMAGECOLOR     255 255 255
  CONFIG          "PROJ_LIB" "C:/ms4w/proj/nad/"
  PROJECTION
    "init=epsg:4326"
  END

  WEB
    IMAGEPATH "C:/Temp/"
    IMAGEURL "/Temp/"
    METADATA
      "wms_title"       "FHWA Census Tract"
      "wms_onlineresource"    "http://localhost/cgi-bin/mapserv?map=census_tract.map&"
      "wms_srs"               "EPSG:4269 EPSG:4326"
    END
  END

  LAYER
    NAME         "censusTracts"
    DATA         CensusTracts
    STATUS       ON
    TYPE         POLYGON

    CLASS
      NAME       "Census Tract"

      STYLE
        COLOR        232 232 232
        OUTLINECOLOR 32 32 32
      END
    END
    METADATA
      "wms_onlineresource"    "http://localhost/cgi-bin/mapserv?map=census_tract.map&"
        "wms_srs"             "EPSG:4269 EPSG:4326"
        "wms_name"            "censusTracts"
        "wms_server_version"  "1.1.1"
      "wms_title"       "census tract"
      "wms_format"            "image/gif"
    END
    PROJECTION
      "init=epsg:4326"
    END
  END
END


My C# code is:
-------------------------------------------------
OWSRequest req = new OWSRequest();

req.setParameter("SERVICE", "WMS");
req.setParameter("VERSION", "1.1.1");
req.setParameter("REQUEST", "GetMap");
req.setParameter("LAYERS", "censusTracts");
req.setParameter("BBOX", "-125.0,20.0,-65.0,50.0");
req.setParameter("SRS", "EPSG:4326");
req.setParameter("WIDTH", "400");
req.setParameter("HEIGHT", "300");
req.setParameter("FORMAT", "image/gif");
req.setParameter("STYLES", "");

mapscript.msIO_installStdoutToBuffer();

int owsResult = map.OWSDispatch(req);
-------------------------------------------------

Does anybody know what my issue could be or at least point me in the right direction?  I have spent a lot of time researching this already and would really appreciate any help.

Thanks,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091104/b70e6dd6/attachment.htm>


More information about the MapServer-users mailing list