[CITE-Forum] GetFeature POST requests with dynamic parameters

Richard Martell rmartell at galdosinc.com
Tue May 27 16:12:38 EDT 2014


Hi Ingo,

You can include the message body either inline or by reference (XInclude). In the end these are equivalent because the 
inclusions are dereferenced before the final XSLT script is generated.

<body>
  <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"  xmlns:ogc="http://www.opengis.net/ogc" service="WFS" version="1.1.0">
    <wfs:Query xmlns:tns="{$tns} " typeName="tns:{$ftname} " srsName="urn:ogc:def:crs:EPSG::4326" />
  </wfs:GetFeature>
</body>

It can be tricky parameterizing the namespace bindings. Note the use of attribute value templates for $tns 
and $ftname. I haven't actually seen this done before in a CTL script; the bindings may be ignored when the 
request is submitted but you can try it out and see.

--
Richard


-----Original Message-----
From: CITE-Forum [mailto:cite-forum-bounces+rmartell=galdosinc.com at lists.opengeospatial.org] On Behalf Of Ingo Simonis
Sent: Tuesday, 27 May, 2014 09:34
To: cite-forum at lists.opengeospatial.org
Subject: [CITE-Forum] GetFeature POST requests with dynamic parameters

Dear All

I am currently working on the WFS-1.1.0 tests to make them independent of the data served by a service instance. As long as KVP-POST is supported, this is not much of a problem, as I can read all necessary information from the capabilities document and then set the request parameters dynamically. The following expert shows this approach:

<code>
      <xsl:variable name="ftname">
        <xsl:value-of select="$CAPABILITIES//wfs:FeatureTypeList/wfs:FeatureType[1]/wfs:Name"/>
      </xsl:variable>
      ...
      <xsl:variable name="request1">
        <request>
          <url>
            <xsl:value-of select="$wfs.DescribeFeatureType.post.url"/>
          </url>
          <method>post</method>
          <param name="service">WFS</param>
          <param name="version">1.1.0</param>
          <param name="request">DescribeFeatureType</param>
          <ctl:param name="typename">
            <xsl:value-of select="$ftname"/>
          </ctl:param>
          ...

The problem arises when KVP-POST is not supported, i.e. when I need to send XML request statements. The common approach is to put request into a separate document and load it at runtime:
<code>
            <xsl:variable name="request1">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.GetFeature.post.url"/>
                    </url>
                    <method>post</method>
                    <body>
                        <xi:include href="wfs-1.1.0-Basic-GetFeature-tc19.1.body.xml"/>
                    </body>


I wonder if there is any approach that allows me to set request parameters dynamically in such a scenario. Is it possible to put all XML inline into the test directly? If yes, how to deal with the namespace settings in such a situation?

Any help highly appreciated, 
Ingo



More information about the CITE-Forum mailing list