[mapserver-users] POST support for GetMap requests

Sushrut Shivaswamy sushrut.shivaswamy at gmail.com
Tue May 2 04:44:10 PDT 2017


Hey,

I have a requirement to style a vector layer without polluting the layer
definition
in the map file with classobjects and such.
The method I have adopted is to use the SLD_Body parameter of a WMS GetMap
request
to receive the styled images.
This has worked so far but now the size of the SLD has grown so much that
exceeds the maximum number of characters permitted in a url.
So I can no longer send my SLD as a part of the GET request.
My SLD request till now was as follows

*http://localhost:8000/
<http://localhost:8000/>cgi-bin/mapserv?service=wms&request=GetMap&version=1.0.0&layers=namespace:layer&sld_body=sld_as_string..*


To overcome this problem I believe POST rquests are a good solution since
the SLD can then be sent as a part of the request body.

However, I am unable to execute a POST GetMap request.

The request body is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows"
            xmlns:gml="http://www.opengis.net/gml"
   version="1.3.0" service="WMS">
   <StyledLayerDescriptor version="1.0.0">
      <NamedLayer>
        <Name>world</Name>
      </NamedLayer>
   </StyledLayerDescriptor>
   <BoundingBox srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
      <gml:coord><gml:X>-130</gml:X><gml:Y>24</gml:Y></gml:coord>
      <gml:coord><gml:X>-55</gml:X><gml:Y>50</gml:Y></gml:coord>
   </BoundingBox>
   <Output>
      <Format>image/png</Format>
      <Size>
      <Width>64</Width>
      <Height>64</Height>
   </Size>
   </Output>
</ogc:GetMap>


On sending this POST request to mapserver I get the error
*msCalculateScale(): General error message. Invalid image width or height.*

Even though the width and height has been specified in the XML.
The above XML works with Geoserver.
Does Mapserver support POST GetMap requests?

Regards,
Sushrut Shivaswamy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170502/c3238ef0/attachment-0001.html>


More information about the mapserver-users mailing list