[Geoserver-devel] [JIRA] (GEOS-9464) When creating a stored query if a wrong namespace is provided GeoServer will save it and not be able to read it back

Nuno Oliveira created an issue

GeoServer / BugGEOS-9464

When creating a stored query if a wrong namespace is provided GeoServer will save it and not be able to read it back

Issue Type:

BugBug

Affects Versions:

2.16.0

Assignee:

Unassigned

Components:

WFS

Created:

23/Jan/20 4:04 PM

Priority:

MediumMedium

Reporter:

Nuno Oliveira

To reproduce just create the following stored query, namespace _http://www.opengis.org/fes/2.0_ is being used instead of _http://www.opengis.net/fes/2.0_:

<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:topp='http://www.openplans.org/topp'>
  <wfs:StoredQueryDefinition id='myStoredQuery3'>
    <wfs:Parameter name='AreaOfInterest' type='gml:Polygon'/>
    <wfs:QueryExpressionText
     returnFeatureTypes='topp:states'
     language='urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression'
     isPrivate='false'>
      <wfs:Query typeNames='topp:states'>
        <fes:Filter>
          <fes:Within>
            <fes:ValueReference>the_geom</fes:ValueReference>
             ${AreaOfInterest}
          </fes:Within>
        </fes:Filter>
      </wfs:Query>
    </wfs:QueryExpressionText>
  </wfs:StoredQueryDefinition>
</wfs:CreateStoredQuery>

GeoServer will internally (inside the data directory) store it like this:

<?xml version="1.0" encoding="UTF-8"?><wfs:StoredQueryDescription xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" id="myStoredQuery3"><wfs:Parameter name="AreaOfInterest" type="gml:Polygon"/><wfs:QueryExpressionText isPrivate="false" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" returnFeatureTypes="topp:states"><wfs:Query wfs:typeNames="topp:states">
        
      <null:Filter xmlns:null="http://www.opengis.org/fes/2.0">
          
        <null:Within>
            
             ${AreaOfInterest}
          <null:ValueReference>the_geom</fes:ValueReference></fes:Within></fes:Filter></wfs:Query></wfs:QueryExpressionText></wfs:StoredQueryDescription>

… and will not be able to read it back, complain with:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:ows="http://www.opengis.net/ows/1.1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">
	<ows:Exception exceptionCode="NoApplicableCode">
		<ows:ExceptionText>java.lang.RuntimeException: Error accessign stoed query: myStoredQuery3
Error accessign stoed query: myStoredQuery3
The element type "null:ValueReference" must be terminated by the matching end-tag "</null:ValueReference>".</ows:ExceptionText>
	</ows:Exception>
</ows:ExceptionReport>

Using strict=true will not have an effect on this, since according to XML rules the the XML is valid, it is just GeoServer who expects a certain namespace.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100118-sha1:cd103a2)

Atlassian logo