[mapserver-users] php mapscript with draw() calling a php wrapper

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Nov 13 08:17:14 PST 2013


I have a web service that use a php wrapper as described here,
http://mapserver.org/fr/ogc/mapscript.html#php-example
 except that there is no mapscript, just php code that makes some query to 
a database in order to add some parametes to the wms request

This wrapper ends with readfile ($url);
It works fine for all wms request.

My problem is when calling this wrapper from another php mapscript page, I 
can't get the image back
More details...
I have a php mapscript who prepare a mapobject to print the map
In this php mapscript I use $oMap->draw(); to get the image

But the layer in $oMap doesn'T have a standard url like 
/cgi-bin/mapserv?map=.....
The url is something like
http://.../php/ows.php?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&LAYERS=......

ows.php build the correct url  /cgi-bin/mapserv?map=.....and does the 
getmap request using readfile($url)

But it seems that $oMap->draw() can't deal with what readfile returns, I 
got this error
Error in msDrawMap(): Failed to draw WMS layer named 'RSS'. This most 
likely happened because the remote WMS server returned an invalid image, 
and XML exception or another unexpected result in response to the GetMap 
request. Also check and make sure that the layer's connection URL is 
valid. 

I'm sorry It's difficult to explain, I hope I explained well enough...
Thanks
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131113/7b4f4642/attachment-0001.html>


More information about the mapserver-users mailing list