Ticket #4171 (new defect)
WFS filter is produced as non-standard XML
| Reported by: | sredl | Owned by: | msogcbugs |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 release |
| Component: | WFS Client | Version: | svn-trunk (development) |
| Severity: | normal | Keywords: | wfs filter xml namespace fes |
| Cc: |
Description
The WFS filter is produced as non-standard XML and therefore MapServer WFS client cannot use filters against other WFS servers (Geoserver and Intergraph at least).
The "wfs_filter" specified in the mapfile in layer metadata is surrounded by <ogc:Filter> </ogc:Filter> tags. This is wrong, as "ogc" namespace is used, but not defined. It works against another MapServer, but other servers use standard XML libraries to parse it and fail. I tried both GET and POST methods and in both cases invalid XML was sent.
As a quick-fix, I propose the attached patch. It allows users to specify the filter with the proper leading tag:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
and works fine for us.
Next step definitely would be to introduce XML namespaces into MapServer and handle them properly.
More info:
Mapfile is here. The GET request I saw
http://88.81.191.230:8080/geoserver/ows?&
REQUEST=GetFeature&
VERSION=1.0.0&
SERVICE=WFS&
TYPENAME=ccss:Flood2010_FloodActivityGrade&
FILTER=<ogc:Filter>
<ogc:PropertyIsEqualTo+xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyName>STUPEN</ogc:PropertyName>
<ogc:Literal>3</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
doesn't work. It can be fixed manually by moving the namespace definition into the filter tag:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyIsEqualTo> ...
The issue is also discussed here: http://lists.osgeo.org/pipermail/mapserver-users/2012-January/071209.html

