[gdal-dev] [WFS Driver] Http Error Code 414

Even Rouault even.rouault at mines-paris.org
Tue Jun 19 12:48:01 PDT 2012


Le mardi 19 juin 2012 21:41:06, xavier lhomme a écrit :
> From specification
> 
> When using the HTTP POST method, the content type for XML encoded WFS
> requests must be set to text/xml.  When using the HTTP POST method, the
> content type for KVP encoded WFS requests must be set to
> application/x-www-form-urlencoded and the content of the document must be
> equivalent to the query string of an HTTP GET request.  That is, the
> content must be equivalent to the string that follows the ‘?’ character in
> a URL encoded GET request.  Of course, the content must be encoded [10] to
> protect special characters.
> 
> Then I will try to split the url after ? Encode the end of the url to
> protect special character, set application/x-www-form-urlencoded and the
> end url to the post parameter....

In fact, the spec describe 2 different methods (the above formatting of the 
text of the specification is a bit confusing. Interested readers should 
directly look at the spec and the table in it).

I didn't remember that KVP could also be used in POST. I thought of the XML 
form, like  :

<?xml version="1.0" ?>
<wfs:GetFeature
service="WFS"
version="1.1.0"
outputFormat="text/xml; subtype=gml/3.1.1"
xmlns:myns="http://www.someserver.com/myns"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd">
<wfs:Query typeName="myns:InWaterA_1M">
<ogc:Filter>
<ogc:GmlObjectId gml:id="InWaterA_1M.1234"/>
</ogc:Filter>

The best is to try of course what works with your server.

> 
> And if not working i will try the xml form...
> Le 19 juin 2012 19:40, "Even Rouault" <even.rouault at mines-paris.org> a
> 
> écrit :
> > Le mardi 19 juin 2012 17:06:17, xavier lhomme a écrit :
> > > Hi
> > > I tried to submit a POST request with the KVP form to an ArcGIS Server
> > 
> > 10.0
> > 
> > > but in response I've got an XML Parsing error.
> > > 
> > >  Do I need to translate the KVP form of the url into an XML form ?
> > 
> > Yes, the content you send in a POST is different from the KVP of a GET.
> > There
> > are examples (if I remember correctly) in the OGC WFS spec.
> > 
> > > xav
> > > 
> > > 
> > > 2012/6/12 Even Rouault <even.rouault at mines-paris.org>
> > > 
> > > > Le mardi 12 juin 2012 14:38:05, xavier lhomme a écrit :
> > > > > Hello
> > > > > 
> > > > >  I'm requesting a WFS source with a very long request. The URI
> > > > >  generated
> > > > 
> > > > by
> > > > 
> > > > > the WFS driver is very long (more than 2048). In return I' ve got
> > > > > an HTTP error code 414.
> > > > > 
> > > > >  OGRWFSDataSource::HTTPFetch function should be protected against
> > 
> > very
> > 
> > > > long
> > > > 
> > > > > URI and switch between a GET request to a POST request.
> > > > 
> > > > Patch welcome and public server for testing :-)
> > > > 
> > > > > best regards
> > > > > xavier


More information about the gdal-dev mailing list