opengeospatial / ets-wfs20

Executable Test Suite for WFS 2.0
Other
8 stars 11 forks source link

Wrong namespace (nts) on request parameter in filter for wfs 2.0 #227

Open dahermansson opened 2 years ago

dahermansson commented 2 years ago

When we use the service at https://cite.opengeospatial.org/teamengine/rest/suites/wfs20/ with the Inspire Validator we get faild tests on a bunch of tests which looks like the reason to fail is a request with a filter thats not correct. The namespace on the field in the filter is set to "tns" like in tns:Identifier the correct way to create the filter is to use gml:Identifier As described in the Issue 746 at Inspire-Validator we can't find any reason for it to use "tnf" as prefix/namespace in the requests.

To Reproduce Steps to reproduce the behavior: Validate a Inspire WFS-service.

Expected behavior Corrected formated filters using the expected field.

Screenshots Attached a ziped testresult (.rdf) TN_Road_WFS2022_05_03.zip

dstenger commented 2 years ago

Thank you for reporting. As this behavior is related to the WFS 2.0 test suite, I moved the issue to the ets-wfs20 issue tracker.

dstenger commented 2 years ago

I can confirm that several tests fail on Production (http://cite.ogc.org/teamengine/) and Beta (http://cite.ogc.org/te2/).

Following test fails several times: property Is Not Like | java.lang.AssertionError: Unexpected HTTP status code. expected <br>[200] but found <br>[400]

Method:     GET

URL:    https://geo-inspire.trafikverket.se/Mapservice/wfs.axd/TN_RoadTransportNetwork?service=WFS&version=2.0.0&request=GetFeature&count=10&typenames=ns93:RoadLink&namespaces=xmlns(xml,http://www.w3.org/XML/1998/namespace),xmlns(ns93,urn:x-inspire:specification:gmlas:RoadTransportNetwork:3.0),xmlns(wfs,http://www.opengis.net/wfs/2.0)&filter=%3CFilter%20xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Ffes%2F2.0%22%20xmlns%3Ans93%3D%22urn%3Ax-inspire%3Aspecification%3Agmlas%3ARoadTransportNetwork%3A3.0%22%20xmlns%3Awfs%3D%22http%3A%2F%2Fwww.opengis.net%2Fwfs%2F2.0%22%3E%3CNot%3E%3CPropertyIsLike%20escapeChar%3D%22%5C%22%20singleChar%3D%22%3F%22%20wildCard%3D%22%2A%22%3E%3CValueReference%20xmlns%3Atns%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%2F3.2%22%3Etns%3Aidentifier%3C%2FValueReference%3E%3CLiteral%3E%2A00%3A5-1%3C%2FLiteral%3E%3C%2FPropertyIsLike%3E%3C%2FNot%3E%3C%2FFilter%3E

Outputs:

<cnt:rest><ExceptionReport xmlns="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://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd">
  <Exception exceptionCode="InvalidParameterValue" locator="ValueReference">
      <ExceptionText>Parameter value is invalid: ValueReference=Requested attribute does not exist.</ExceptionText>
  </Exception>
</ExceptionReport></cnt:rest>

and

Method:     POST

URL:    https://geo-inspire.trafikverket.se/Mapservice/wfs.axd/TN_RoadTransportNetwork

Body:   
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" count="10" service="WFS"
                version="2.0.0">
   <wfs:Query xmlns:ns56="urn:x-inspire:specification:gmlas:RoadTransportNetwork:3.0"
              typeNames="ns56:RoadLink">
      <Filter xmlns="http://www.opengis.net/fes/2.0">
         <Not>
            <PropertyIsLike escapeChar="\" singleChar="?" wildCard="*">
               <ValueReference xmlns:tns="http://www.opengis.net/gml/3.2">tns:identifier</ValueReference>
               <Literal>*00:5-1</Literal>
            </PropertyIsLike>
         </Not>
      </Filter>
   </wfs:Query>
</wfs:GetFeature>

Outputs:    
<cnt:rest><ExceptionReport xmlns="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://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd">
  <Exception exceptionCode="InvalidParameterValue" locator="ValueReference">
      <ExceptionText>Parameter value is invalid: ValueReference=Requested attribute does not exist.</ExceptionText>
  </Exception>
</ExceptionReport></cnt:rest>

This was already described in the description of this issue.

However, several other tests also fail but with a different error message: E.g. property Is Greater Than_match Any, get Features By Type or property Is Less Than Equal To_match Any. @dahermansson Are you aware of those additional failures?

@bpross-52n Can you please do a deeper analysis why the property Is Not Like tests fail as documented above?

dstenger commented 2 years ago

@dahermansson It appears that your service is ignoring the declaration of namespaces. Please see following snippet of the request:

<ValueReference xmlns:tns="http://www.opengis.net/gml/3.2">tns:identifier</ValueReference>

The GML namespace is bound to tns prefix. So, the correct namespace is used in the request.

You need to configure your server to be namespace aware.