[mapserver-users] MapServer 7.0 WFS post request using ogc filter

TMa Teng TMa at edrnet.com
Wed Aug 17 10:31:40 PDT 2016


Yes, I am able to use GET method to get the features when use the WFS.

Get request example:
http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/SanbornImage_wfs.map&REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=SanbornGeoref&MAXFEATURES=20&bbox=-72.93411254882812,41.30730211327143,-72.93099045753479,41.30866411858396

It returns features as expected.

The problem is when I try to get features using POST method on the same WFS (see raw in fiddler below):

POST http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/SanbornImage_wfs.map HTTP/1.1
Content-Type: multipart/form-data; 
User-Agent: Fiddler
Content-Length: 814
Host: gisappsdev:8080

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="100" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <wfs:Query typeName="SanbornGeoref" xmlns:feature="http://gisappsdev:8080/cgi-bin/mapserv.exe" srsName="EPSG:4326">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
       <ogc:BBOX>
        <ogc:PropertyName>shape</ogc:PropertyName>
        <gml:Envelope xmlns:gml="http://www.opengis.net/gml">
          <gml:lowerCorner>-81 41</gml:lowerCorner>
          <gml:upperCorner>-80.9 41.01</gml:upperCorner>
        </gml:Envelope>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

It took very long to return a 504 error gameway timeout.

Thanks,


-----Original Message-----
From: Even Rouault [mailto:even.rouault at spatialys.com] 
Sent: Wednesday, August 17, 2016 12:01 PM
To: TMa Teng <TMa at edrnet.com>
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

Le mercredi 17 août 2016 17:44:54, TMa Teng a écrit :
> Thank you Even. The error message is " The gateway did not receive a 
> timely response from the upstream server or application".

Do other GetFeature queries work ? GetCapabilities ? 

> 
> I didn’t specify the srsname in the query since output is defined in
> EPSG:4326 same as the mapfile. I have an identical server that has not 
> been upgrade to mapserver 7.0 yet. And it returns the fesature 
> collection successfully using exact the same mapfile and same request body.
> 
> Martin
> 
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at spatialys.com]
> Sent: Wednesday, August 17, 2016 11:37 AM
> To: mapserver-users at lists.osgeo.org
> Cc: TMa Teng <TMa at edrnet.com>
> Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using 
> ogc filter
> 
> Le mercredi 17 août 2016 16:57:44, TMa Teng a écrit :
> > Hi guys,
> > 
> > I am currently facing problems using WFS in MapServer 7.0. The WFS 
> > works in MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile, 
> > database connection everything has not been changed. Is there any 
> > change to WFS call from MapServer version 6.0 to version 7.x? Please 
> > advise me if there is anything I am missing.
> 
> You didn't explain what didn't work exactly. Like do you get a 
> response with zero features in it ?
> 
> This might be an issue with the coordinate order of  in lowerCorner 
> and upperCorner query. I assume that the SRS of the layer is EPSG:4326 
> ? If so, you should likely put the values in latitude longitude order 
> (they look like being longitude latitude in your below sample). And it 
> would also be better to explictly specify the SRS by adding a 
> srsName="urn:ogc:def:crs:EPSG::4326" attribute to the <gml:Envelope> 
> element.
> 
> > My request body:
> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> > version="1.1.0" maxFeatures="200"
> > xsi:schemaLocation="http://www.opengis.net/wfs
> > http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <wfs:Query 
> > typeName="parcelpoints"
> > xmlns:feature="http://mapserver.gis.umn.edu/mapserver"> <ogc:Filter 
> > xmlns:ogc="http://www.opengis.net/ogc">
> > 
> >       <ogc:BBOX>
> >       
> >         <ogc:PropertyName>shape</ogc:PropertyName>
> >         <gml:Envelope xmlns:gml="http://www.opengis.net/gml">
> >         
> >           <gml:lowerCorner>-81 41</gml:lowerCorner>
> >           <gml:upperCorner>-80.9 41.01</gml:upperCorner>
> >         
> >         </gml:Envelope>
> >       
> >       </ogc:BBOX>
> >     
> >     </ogc:Filter>
> >   
> >   </wfs:Query>
> > 
> > </wfs:GetFeature>
> > 
> > Thanks in advance,
> > 
> > Martin
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the mapserver-users mailing list