[mapserver-users] Mapserfer Wfs and Mapinfo

Frank Warmerdam warmerdam at pobox.com
Fri Jul 4 10:47:29 EDT 2008


Iacovlev Pavel wrote:
> Ok I know where the bug is, first of all as written In the begging of the post 
> I run the wfs server as phpmapscript, so that means no CGI, to load the 
> parameters passed to the script I use : 
> 
> $request = ms_newowsrequestobj();
> foreach ($_REQUEST as $key =>$value) {
> 	$request->setParameter($key, $value);
> }
> 
> not because I love this way, just because $request->loadParams(); just does 
> not work in non CGI environment at all. 
> 
> Ok now in GetCapabilities response we tell the WFS client "<Post 
> onlineResource="http://dev1.dmsolutions.ca/cgi-bin/mswfs_gmap?"/>" hey we can 
> accept RAW XML DATA as POST, that data comes to PHP but it's not in the 
> $_REQUEST object, but in "php://input", that means that $request does not get 
> populated and we get an "empty" request.
> 
> 2 ways of fixing this :
> 1) Easy & Dirty :
> $buffer = str_replace("<Post 
> onlineResource=\"$yourWfsServerAddressHere\" />", '', $buffer);
> 
> this will just won't allow the client to send HTTP POST REQUEST with XML RAW 
> DATA
> 
> 2) Pupulate the request object withRAW  XML DATA, need help from the community 
> here : "How do you populate the $request = ms_newowsrequestobj(); with RAW 
> XML DATA" ?

Iacovlev,

I have reviewed the code and can fairly conclusively say that currently
there is no mapscript mechanism to push an XML Post request into the
OWS request object to be processed as normal post requests are.

To implement this, we would need to actually implement the msIO_bufferRead()
function in mapio.c, and add a function to push data into this buffer
(something roughly like msIO_getStdoutBufferString() and
msIO_getStdoutBufferBytes() from mapscript/swiginc/msio.i but in the
opposite direction).

I have created a Trac ticket to note this issue, but I have no plans to
implement it in the forseeable future.

   http://trac.osgeo.org/mapserver/ticket/2681

I would be willing to implement it in 5.4 if there was a sufficiently savvy
collaborator willing to help test and debug it (including building from source
themselves).

NOTE: This issue only affects someone wanting to use POST requests to WxS
services from mapscript in a non-cgi environment (like mod_php or mod_python).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list