DescribeStoredQueries

The DescribeStoredQueries operation returns detailed metadata about each stored query maintained by the WFS server. A description of an individual query may be requested by providing the ID of the specific query. If no ID is provided, all queries are described. An invalid stored query ID will return an exception report. DescribeStoredQueries is supported only for WFS versions 2.0.0 and 2.0.2 through GET (KVP) and POST (XML) requests only. Only GetFeatureById is currently supported, which return a description of one stored query called GetFeatureById for KVP and XML.

GET Request

The GET request contains:

Input Required Description
SERVICE=WFS Yes Fixed to WFS.
REQUEST=DescribeStoredQueries Yes Set to DescribeStoredQueries for a describe feature type of operation.
VERSION Yes The supported version of the Web Feature Service standard (for this operation, either 2.0.0 or 2.0.2).
STOREDQUERY_ID=<stored query ID or IDs separated by comma> No Specific stored query ID or IDs to be described.

Sample GET request with KVP:

http://<server>:<port>/rest/Spatial/WFS?SERVICE=WFS&REQUEST=DescribeStoredQueries&VERSION=2.0.0

POST Request

Sample POST request with XML (version 2.0.0 only; the StoredQueryID uses the URN format):

<wfs:DescribeStoredQueries
version="2.0.0"
service="WFS"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
               <wfs:StoredQueryId>urn:ogc:def:query:OGC-WFS::GetFeatureById</wfs:StoredQueryId>
</wfs:DescribeStoredQueries>

Sample POST request with XML (version 2.0.2 only; the StoredQueryID uses the URL (http) format):

<wfs:DescribeStoredQueries
version="2.0.2"
service="WFS"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
               <wfs:StoredQueryId>http://www.opengis.net/def/query/OGC-WFS/0/GetFeatureById</wfs:StoredQueryId>
</wfs:DescribeStoredQueries>

Sample Response (v2.0.0)

<wfs:DescribeStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0/wfs.xsd">
		<wfs:StoredQueryDescription id="urn:ogc:def:query:OGC-WFS::GetFeatureById">
			<wfs:Title xml:lang="en">Get Feature By Identifier</wfs:Title>
			<wfs:Abstract>
				This stored query accepts a single argument, named "id" and of type xsd:string, and shall return a single feature with the identifier specified as its argument.
			</wfs:Abstract>
			<wfs:Parameter name="ID" type="xs:string">
				<wfs:Title>The Feature Id</wfs:Title>
				<wfs:Abstract>The id of the feature to be returned</wfs:Abstract>
			</wfs:Parameter>
			<wfs:QueryExpressionText xmlns:miwfs="http://www.mapinfo.com/wfs" xmlns:miwfs2="http://www.mapinfo.com/wfs2" returnFeatureTypes="miwfs:World miwfs:WorldCap miwfs:USA miwfs:USACap miwfs2:World miwfs:UK_REGNS miwfs:UKCTY215 miwfs:txairportswithtimefields" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" isPrivate="true"/>
		</wfs:StoredQueryDescription>
	</wfs:DescribeStoredQueriesResponse>

Sample Response (v2.0.2)

<wfs:DescribeStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0/wfs.xsd">
	<wfs:StoredQueryDescription id="http://www.opengis.net/def/query/OGC-WFS/0/GetFeatureById">
		<wfs:Title xml:lang="en">Get Feature By Identifier</wfs:Title>
		<wfs:Abstract>
			This stored query accepts a single argument, named "id" and of type xsd:string, and shall return a single feature with the identifier specified as its argument.
		</wfs:Abstract>
		<wfs:Parameter name="ID" type="xs:string">
			<wfs:Title>The Feature Id</wfs:Title>
			<wfs:Abstract>The id of the feature to be returned</wfs:Abstract>
		</wfs:Parameter>
		<wfs:QueryExpressionText xmlns:miwfs="http://www.mapinfo.com/wfs" xmlns:miwfs2="http://www.mapinfo.com/wfs2" returnFeatureTypes="miwfs:World miwfs:WorldCap miwfs:USA miwfs:USACap miwfs2:World miwfs:UK_REGNS miwfs:UKCTY215 miwfs:txairportswithtimefields" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" isPrivate="true"/>
	</wfs:StoredQueryDescription>
</wfs:DescribeStoredQueriesResponse>