All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wfs.1.1.0.ctl.basic.GetCapabilities.GetCapabilities-POST.xml Maven / Gradle / Ivy

Go to download

Verifies conformance of implementations to the OGC Web Feature Service (WFS 1.1.0)Standard.

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<ctl:package
        xmlns="http://www.occamlab.com/ctl"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:ctl="http://www.occamlab.com/ctl"
        xmlns:parsers="http://www.occamlab.com/te/parsers"
        xmlns:p="http://teamengine.sourceforge.net/parsers"
        xmlns:saxon="http://saxon.sf.net/"
        xmlns:wfs="http://www.opengis.net/wfs"
        xmlns:ows="http://www.opengis.net/ows"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <ctl:test name="wfs:run-GetCapabilities-POST">
    <param name="wfs.GetCapabilities.document"/>
    <ctl:assertion>
      Run test group for GetCapabilities requests using the POST method. Target endpoint is
      {$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetCapabilities']/ows:DCP/ows:HTTP/ows:Post/@xlink:href}.
    </ctl:assertion>
    <ctl:code>

      <xsl:variable name="wfs.GetCapabilities.post.url">
        <xsl:value-of
                select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetCapabilities']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
      </xsl:variable>
      <xsl:variable name="kvp-post-supported"
                    select="boolean($wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetCapabilities']/ows:DCP/ows:HTTP/ows:Post/ows:Constraint[@name='InputFormat' and ows:Value='application/x-www-form-urlencoded'])"/>

      <ctl:call-test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc2.1">
        <ctl:with-param name="wfs.GetCapabilities.post.url" select="$wfs.GetCapabilities.post.url"/>
      </ctl:call-test>
      <xsl:if test="$kvp-post-supported">
        <ctl:call-test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc2.2">
          <ctl:with-param name="wfs.GetCapabilities.post.url" select="$wfs.GetCapabilities.post.url"/>
        </ctl:call-test>
      </xsl:if>
      <ctl:call-test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc20.1">
        <ctl:with-param name="wfs.GetCapabilities.post.url" select="$wfs.GetCapabilities.post.url"/>
      </ctl:call-test>
      <ctl:call-test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc21.1">
        <ctl:with-param name="wfs.GetCapabilities.post.url" select="$wfs.GetCapabilities.post.url"/>
      </ctl:call-test>

    </ctl:code>
  </ctl:test>

  <test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc2.1">
    <param name="wfs.GetCapabilities.post.url"/>
    <assertion>The POST method may be supported using either the XML or KVP entity representations.</assertion>
    <comment>GetCapabilities using XML POST. Pass if all of the following conditions are true: (1) the response is
      schema valid; (2) the root document is a wfs:WFS_Capabilities document as expected.
    </comment>
    <link>wfs-1.1.0-Basic-GetCapabilities-atc3</link>
    <link>OGC 04-094, 13.1, p.79</link>
    <code>

      <xsl:variable name="request1">
        <request>
          <url>
            <xsl:value-of select="$wfs.GetCapabilities.post.url"/>
          </url>
          <method>post</method>
          <body>
            <xi:include href="wfs-1.1.0-Basic-GetCapabilities-tc2.1.body.xml"/>
          </body>
          <p:XMLValidatingParser.GMLSF1/>
        </request>
      </xsl:variable>

      <xsl:choose>
        <xsl:when test="not($request1/*)">
          <ctl:message>ERROR: Missing response entity.</ctl:message>
          <ctl:fail/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="expression">//wfs:WFS_Capabilities</xsl:variable>
          <ctl:call-test name="ctl:assert-xpath">
            <ctl:with-param name="expr" select="$expression"/>
            <ctl:with-param name="doc" select="$request1"/>
          </ctl:call-test>
        </xsl:otherwise>
      </xsl:choose>

    </code>
  </test>

  <test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc2.2">
    <param name="wfs.GetCapabilities.post.url"/>
    <assertion>The POST method may be supported using either the XML or KVP entity representations.</assertion>
    <comment>GetCapabilities using KVP over POST. Pass if all of the following conditions are true: (1) the response is
      schema valid; (2) the root document is a wfs:WFS_Capabilities document as expected.
    </comment>
    <link>wfs-1.1.0-Basic-GetCapabilities-atc3</link>
    <link>OGC 04-094, 13.1, p.79</link>
    <code>

      <xsl:variable name="request1">
        <request>
          <url>
            <xsl:value-of select="$wfs.GetCapabilities.post.url"/>
          </url>
          <method>post</method>
          <param name="request">GetCapabilities</param>
          <param name="service">WFS</param>
          <param name="version">1.1.0</param>
          <p:XMLValidatingParser.GMLSF1/>
        </request>
      </xsl:variable>

      <xsl:choose>
        <xsl:when test="not($request1/*)">
          <ctl:message>ERROR: Missing response entity.</ctl:message>
          <ctl:fail/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="expression">//wfs:WFS_Capabilities</xsl:variable>
          <ctl:call-test name="ctl:assert-xpath">
            <ctl:with-param name="expr" select="$expression"/>
            <ctl:with-param name="doc" select="$request1"/>
          </ctl:call-test>
        </xsl:otherwise>
      </xsl:choose>

    </code>
  </test>

  <test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc20.1">
    <param name="wfs.GetCapabilities.post.url"/>
    <assertion>The Content-Type of all XML request entities must be 'application/xml'.</assertion>
    <comment>GetCapabilities with the encoding as 'application/xml' (default). Pass if all of the following conditions
      are true: (1) the response is schema valid; (2) the root document is a wfs:WFS_Capabilities document.
    </comment>
    <link>wfs-1.1.0-Basic-atc-11</link>
    <link>OGC 04-094, 6.5.1, p.13</link>
    <code>

      <xsl:variable name="request1">
        <request>
          <url>
            <xsl:value-of select="$wfs.GetCapabilities.post.url"/>
          </url>
          <method>post</method>
          <body>
            <xi:include href="wfs-1.1.0-Basic-GetCapabilities-tc20.1.body.xml"/>
          </body>
          <p:XMLValidatingParser.GMLSF1/>
        </request>
      </xsl:variable>

      <xsl:choose>
        <xsl:when test="not($request1/*)">
          <ctl:message>ERROR: Missing response entity.</ctl:message>
          <ctl:fail/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="expression">//wfs:WFS_Capabilities</xsl:variable>
          <ctl:call-test name="ctl:assert-xpath">
            <ctl:with-param name="expr" select="$expression"/>
            <ctl:with-param name="doc" select="$request1"/>
          </ctl:call-test>
        </xsl:otherwise>
      </xsl:choose>

    </code>
  </test>

  <test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc21.1">
    <param name="wfs.GetCapabilities.post.url"/>
    <assertion>A valid XML request entity submitted using the POST method must conform to the declaration of the
      ows:GetCapabilities element.
    </assertion>
    <comment>Pass if all of the following conditions are true: (1) the response is schema valid; (2) the root document
      is a wfs:WFS_Capabilities document.
    </comment>
    <link>ows-1.0.0-metadata-atc8</link>
    <link>OGC 05-008c1, 7.2.3, p.12</link>
    <code>

      <xsl:variable name="request1">
        <request>
          <url>
            <xsl:value-of select="$wfs.GetCapabilities.post.url"/>
          </url>
          <method>post</method>
          <body>
            <xi:include href="wfs-1.1.0-Basic-GetCapabilities-tc21.1.body.xml"/>
          </body>
          <p:XMLValidatingParser.GMLSF1/>
        </request>
      </xsl:variable>

      <xsl:choose>
        <xsl:when test="not($request1/*)">
          <ctl:message>ERROR: Missing response entity.</ctl:message>
          <ctl:fail/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="expression">//wfs:WFS_Capabilities</xsl:variable>
          <ctl:call-test name="ctl:assert-xpath">
            <ctl:with-param name="expr" select="$expression"/>
            <ctl:with-param name="doc" select="$request1"/>
          </ctl:call-test>
        </xsl:otherwise>
      </xsl:choose>

    </code>
  </test>

</ctl:package>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy