opengeospatial / ets-wfs20

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

CreateStoredQueryTests#createGetFeatureByTypeName fails because missing namespace declaration in query #160

Closed mlaghi closed 4 years ago

mlaghi commented 5 years ago

The stored query was successfully created but when it is invoked with GetFeature it fails because the query lacks the namespace definition (here it would be xmlns:tns="http://www.avitech.aero/axl/wfs/2.0/demo") and thereby even if the XML is valid it lacks the binding between the prefix tns and its associated uri:

`

tns:Person ` The stored query definition was: ` GetFeatureByTypeName Returns feature representations by type name. Qualified name of feature type (required). ` We tested the behaviour with version 1.32
dstenger commented 4 years ago

Thank you for reporting.

@keshav-nangare Can you please analyse this issue?

keshavnangare commented 4 years ago

@mlaghi

Can you please provide service to reproduce this issue?

dstenger commented 4 years ago

@keshav-nangare Can you please check if the test can be updated to use custom namespaces as well?

mlaghi commented 4 years ago

I could not find the branch in which you did the fix so I re-ran the test with the master/head branch which is still failing. Meanwhile we made the service available from the internet. You can access the service under:

https://wfst.axl.aero/AxlRest/wfs?SERVICE=WFS&VERSION=2.0.2&REQUEST=GetCapabilities

keshavnangare commented 4 years ago

@mlaghi

I have tried to reproduce the reported issue with the above service but get the different error as follows:

Exception: Expected one or more feature instances in response (type: {http://www.avitech.aero/axl/wfs/2.0/demo}Person). expected [true] but found [false]

Request:

URL:    https://wfst.axl.aero/AxlRest/wfs

Body:   
<CreateStoredQuery xmlns="http://www.opengis.net/wfs/2.0" service="WFS" version="2.0.0">
  <StoredQueryDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                          id="urn:example:wfs2-query:GetFeatureByTypeName">
      <Title>GetFeatureByTypeName</Title>
      <Abstract>Returns feature representations by type name.</Abstract>
      <Parameter name="typeName" type="xsd:QName">
         <Abstract>Qualified name of feature type (required).</Abstract>
      </Parameter>
      <QueryExpressionText isPrivate="false"
                           language="urn:ogc:def:queryLanguage:OGC-WFS::WFSQueryExpression"
                           returnFeatureTypes="">
         <Query typeNames="${typeName}"/>
      </QueryExpressionText>
  </StoredQueryDefinition>
</CreateStoredQuery>

Outputs:    

<cnt:rest><CreateStoredQueryResponse xmlns="http://www.opengis.net/wfs/2.0" status="OK"/></cnt:rest>
mlaghi commented 4 years ago

@keshav-nangare I get the same error, however the error occurs not when storing the query but when executing it with GetFeature (the next operation done by the testsuite). The error you mention is then a consequence since:

keshavnangare commented 4 years ago

Thank you for details.

keshavnangare commented 4 years ago

@mlaghi

I have added a fix for it, now it will use the appropriate prefix. Can you please check? Let me know if still facing this issue.

Thank you!!

mlaghi commented 4 years ago

I just ran the issue#160 branch and I can confirm that the test now behaves as expected and correctly. Thanks. In my opinion this issue can be closed.