[Geoserver-devel] GeoServer 1.6.4b WFS Request namespace problem

I have a problem with a WFS GetFeature request:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <PropertyName>CHCATPARTICELLE</PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

The problem is that the <PropertyName> tag in the Filter is parsed as a Literal, not as a PropertyName.
Everything is parsed correctly if I change the request to:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <ogc:PropertyName>CHCATPARTICELLE</ogc:PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

adding the ogc namespace prefix to PropertyName.
Is this a bug? Where can I look in the code to try to fix it?

Thanks,
Mauro Bartolomeoli

Hi Mauro,

Which previous version did you see this work in. While I do agree that this case could be a bit more lenient, but when dealing with invalid requests you are on shaky ground. If GeoServer was operating in strict mode it would throw a validation exception on this request. The best way (if possible) would be just to be include the ogc prefix.

However, if this did work in a previous version feel free to file a regression issue in the tracker for it.

-Justin

Mauro Bartolomeoli wrote:

I have a problem with a WFS GetFeature request:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <PropertyName>CHCATPARTICELLE</PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

The problem is that the <PropertyName> tag in the Filter is parsed as a Literal, not as a PropertyName.
Everything is parsed correctly if I change the request to:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <ogc:PropertyName>CHCATPARTICELLE</ogc:PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

adding the ogc namespace prefix to PropertyName.
Is this a bug? Where can I look in the code to try to fix it?

Thanks,
Mauro Bartolomeoli

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,4860e3ee308361015089218!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Mauro Bartolomeoli ha scritto:

I have a problem with a WFS GetFeature request:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <PropertyName>CHCATPARTICELLE</PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

The problem is that the <PropertyName> tag in the Filter is parsed as a Literal, not as a PropertyName.
Everything is parsed correctly if I change the request to:

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml&quot; xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <Query xmlns:jesi20="http://www.esalab.it/jesi20&quot; typeName="jesi20:CATPARTICELLE">
       <PropertyName>CHCATPARTICELLE</PropertyName>
       <PropertyName>GEOMETRY</PropertyName>
       <Filter>
           <PropertyIsEqualTo>
               <ogc:PropertyName>CHCATPARTICELLE</ogc:PropertyName>
               <Literal>E388337108002</Literal>
           </PropertyIsEqualTo>
       </Filter>
   </Query>
</GetFeature>

adding the ogc namespace prefix to PropertyName.
Is this a bug? Where can I look in the code to try to fix it?

Actually no, it's not, only the second request is correct. You're
declaring "http://www.opengis.net/wfs&quot; as the default namespace, whilst
the filter elements do reside in the ogc namespace. The parser is looking for an OGC:PropertyName element as a child of the filter
and failing... probably due to the fact there is a wfs omonimous.
The totally correct way to setup the filter would be to use
ogc: prefix for all elements under filter (Filter included).

Cheers
Andrea

Actually no, it's not, only the second request is correct. You're
declaring "http://www.opengis.net/wfs&quot; as the default namespace, whilst
the filter elements do reside in the ogc namespace. The parser is looking for an OGC:PropertyName element as a child of the filter
and failing... probably due to the fact there is a wfs omonimous.

Perfect, I think this is the case. The syntax was accepted in 1.5.3, but I presume it's time for me to send correct requests. I will double check my code.
Thanks for the answer.

Mauro

Mauro Bartolomeoli ha scritto:

Actually no, it's not, only the second request is correct. You're
declaring "http://www.opengis.net/wfs&quot; as the default namespace, whilst
the filter elements do reside in the ogc namespace. The parser is looking for an OGC:PropertyName element as a child of the filter
and failing... probably due to the fact there is a wfs omonimous.

Perfect, I think this is the case. The syntax was accepted in 1.5.3, but I presume it's time for me to send correct requests. I will double check my code.
Thanks for the answer.

If you want GeoServer can become very picky and validate requests
against the schemas for you. Just post to
http://host:port/geoserver/wfs?strict=true
instead of the usual
http://host:port/geoserver/wfs

and you'll get back plenty of messages
Cheers
Andrea