[mapserver-users] problem with MapServer as WMS client

Mr. Puneet Kishor punk.kish at gmail.com
Sun Oct 16 15:28:12 PDT 2011


On Oct 16, 2011, at 3:00 PM, Rahkonen Jukka wrote:

> Hi,
> 
> Have you tried to do it like it is suggested in the documentation http://mapserver.org/ogc/wms_client.html?
> 
> LAYER
>  NAME "country_bounds"
>  TYPE RASTER
>  STATUS ON
>  CONNECTION "http://demo.mapserver.org/cgi-bin/wms?"
>  CONNECTIONTYPE WMS
>  METADATA
>    "wms_srs"             "EPSG:4326"
>    "wms_name"            "country_bounds"
>    "wms_server_version"  "1.1.1"
>    "wms_format"          "image/gif"
>  END
> END
> 
> Thus no PROJECTION for the layer and only EPSG:4326 in wms_srs.  EPSG:900913 must be included in the MAP level "wms_srs" but that should be enough.


That was it. Thanks.... no PROJECTION for the layer, and only EPSG:4326 in wms_srs. Additionally, I was too smart for my own good and had set the TYPE to POLYGON. I guess it should be RASTER because, from the perspective of MapServer, it is getting back an image, no?


> 
> Including name of the remote mapfile into CONNECTION string is OK.
> Perhaps addind DEBUG 5 into your WMS layer definition writes the request into log file but I do not know. Try and see if it helps.


I did bump the DEBUG level to 5, but that doesn't show the WMS calls.


>  At least you can run some local proxy like Fiddled and let it log the web traffic. In that case you will need to add wms_proxy_host and wms_proxy_port into layer metadata.
> 
> -Jukka Rahkonen- 
> 
> ________________________________________
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] käyttäjän Puneet Kishor [punk.kish at gmail.com] puolesta
> Lähetetty: 16. lokakuuta 2011 2:57
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: [mapserver-users] problem with MapServer as WMS client
> 
> I am going from OpenLayers to MapServer acting as a WMS client to a remote server. OL is requesting SRS 900913, and the remote server is sending data in 4326, and I want to send it back to OL in 900913. My layer definition is like so
> 
>        LAYER
>                NAME "foo"
>                TYPE POLYGON
>                STATUS ON
>                CONNECTION "http://server/cgi-bin/mapserv?map=mapfile.map"
>                CONNECTIONTYPE WMS
> 
>                PROJECTION
>                        "init=epsg:4326"
>                END
> 
>                METADATA
>                        wms_srs                 "EPSG:900913 EPSG:4326"
>                        wms_name                "foo"
>                        wms_server_version      "1.1.1"
>                        wms_format              "image/png"
>                        wms_enable_request      "*"
>                        wms_extent              "-180 -90 180 90"
>                END
>        END
> 
> I am getting the following error
> 
> msWMSLoadGetMapParams(): WMS server error. Invalid SRS given: SRS must be valid for all requested layers.
> 
> I have three questions:
> 
> 1. The docs at http://mapserver.org/ogc/wms_client.html state that the connection should not have any query params, but I don't see any options to pass the map file name. Is it ok the way I am doing it above?
> 
> 2. How do I get around the above error?
> 
> 3. Is there a way I can see the actual request that MapServer is making to the remote server, perhaps in the error.log?
> 
> 
> --
> Puneet Kishor_______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list