Closed zguo closed 6 years ago
Thank you for reporting.
You are right, ${typeName}
is not replaced and namespace binding not added.
This must be fixed in the test.
The placeholder ${typeName} is a parameter which is defined before in the StoredQueryDefintion:
<Parameter name="typeName" type="xsd:QName">
But of course the attribute returnFeatureTypes is defined as follows [1]:
<xsd:list itemType="xsd:QName"/>
That's why the schema validation fails.
Correct would be:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<CreateStoredQuery xmlns="http://www.opengis.net/wfs/2.0" xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0" service="WFS" version="2.0.0">
...
<QueryExpressionText isPrivate="false" language="http://qry.example.org"
returnFeatureTypes="LIST_OF_ALL_PROVIDED_FEATURE_TYPES">
<Query typeNames="${typeName}"/>
...
</CreateStoredQuery>
An other option (see #100) would be an empty attribute:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<CreateStoredQuery xmlns="http://www.opengis.net/wfs/2.0" xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0" service="WFS" version="2.0.0">
...
<QueryExpressionText isPrivate="false" language="http://qry.example.org"
returnFeatureTypes="">
<Query typeNames="${typeName}"/>
...
</CreateStoredQuery>
returnFetaureType was set to an empty string: PR #118
Test create Stored Query With Unsupported Query Language
does not fail.
Test was executed with Docker Image which can be built in this repository.
post request url http://inspiredemo.esri.com:6080/arcgis/rest/services/au/MapServer/exts/InspireFeatureDownload/service
the request sent by the test:
response
Error: Expected locator attribute to contain 'language']
Analysis: Method: createStoredQueryWithUnsupportedQueryLanguage() creates a POST request based on CreateStoredQuery-GetFeatureByTypeName.xml template, if substitute ${typeName} in request with the real typeName and add xmlns value from capabilities. the response will give correct locator='language'
Expected request to be sent (example): the difference is at: xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0" returnFeatureTypes="au:AdministrativeBoundary" typeNames="au:AdministrativeBoundary"