The issue can be reproduced using the same setup as FeatureGML32Test (gs-app-schema-test module), but the backing datastore must be a database (I’m testing on PostGIS).
Create the following stored query:
<wfs:CreateStoredQuery service="WFS" version="2.0.0"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:fes="http://www.opengis.org/fes/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:gsml="urn:cgi:xmlns:CGI:GeoSciML-Core:3.0.0">>
<wfs:StoredQueryDefinition id="myStoredQuery">
<wfs:Parameter name="descr" type="xs:string"/>
<wfs:QueryExpressionText
returnFeatureTypes="gsml:MappedFeature"
language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"
isPrivate="false">
<wfs:Query typeNames="gsml:MappedFeature">
<fes:Filter>
<fes:PropertyIsEqualTo
<fes:ValueReference>gsml:MappedFeature/gsml:specification/gsml:GeologicUnit/gml:description</fes:ValueReference>
${descr}
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</wfs:QueryExpressionText>
</wfs:StoredQueryDefinition>
</wfs:CreateStoredQuery>
The StoredQuery is created correctly, but the following GetFeature request returns nothing:
<wfs:GetFeature service="WFS" version="2.0.0"
xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.org/fes/2.0">
<wfs:StoredQuery id="myStoredQuery">
<wfs:Parameter name="descr">
<fes:Literal>Olivine basalt</fes:Literal>
</wfs:Parameter>
</wfs:StoredQuery>
</wfs:GetFeature>
The same query returns one result if used on its own (i.e. without encapsulating it in a StoredQuery).
Apparently, the issue has to do with the XPath expression not being resolved properly, due to missing namespace definitions in the XML parser’s context.
|