Stored query with geoserver

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Stored query with geoserver

Jonas Nygaard Pedersen

Hi List,

 

I’m trying to create a stored query for a an INSPIRE wfs (plu).

But I can’t seem to get it right. Can anyone here see what I’m doing wrong?

 

The stored query (filename: plu_inspire_storedquery.xml) :

 

<?xml version="1.0" encoding="UTF-8"?>

<wfs:CreateStoredQuery xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:plu="http://inspire.ec.europa.eu/schemas/plu/4.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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" service="WFS" version="2.0.0">

  <wfs:StoredQueryDefinition id="http://inspire.ec.europa.eu/operation/download/GetSpatialDataSet">

    <wfs:Title>Get Spatial Data Set</wfs:Title>

    <wfs:Abstract>This stored query enables the download of a complete spatial data set.</wfs:Abstract>

    <wfs:Parameter name="DataSetIdCode" type="xsd:string"/>

    <wfs:QueryExpressionText returnFeatureTypes="plu:OfficialDocumentation plu:SpatialPlan plu:ZoningElement" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" isPrivate="false">

      <wfs:Query typeNames="plu:OfficialDocumentation">

        <fes:Filter>

          <fes:PropertyIsEqualTo>

            <fes:ValueReference>plu:inspireId/base:Identifier/base:namespace</fes:ValueReference>

            <fes:Literal>${DataSetIdCode}</fes:Literal>

          </fes:PropertyIsEqualTo>

        </fes:Filter>

      </wfs:Query>

      <wfs:Query typeNames="plu:SpatialPlan">

        <fes:Filter>

          <fes:PropertyIsEqualTo>

            <fes:ValueReference>plu:inspireId/base:Identifier/base:namespace</fes:ValueReference>

            <fes:Literal>${DataSetIdCode}</fes:Literal>

          </fes:PropertyIsEqualTo>

        </fes:Filter>

      </wfs:Query>

      <wfs:Query typeNames="plu:ZoningElement">

        <fes:Filter>

          <fes:PropertyIsEqualTo>

            <fes:ValueReference>plu:inspireId/base:Identifier/base:namespace</fes:ValueReference>

            <fes:Literal>${DataSetIdCode}</fes:Literal>

          </fes:PropertyIsEqualTo>

        </fes:Filter>

      </wfs:Query>

    </wfs:QueryExpressionText>

  </wfs:StoredQueryDefinition>

</wfs:CreateStoredQuery>

 

The curl command to create the query:

curl -vvv --header "Content-Type: text/xml" --data @plu_inspire_storedquery.xml --output curl_createstoredquery_log.txt http://localhost:8061/plu/wfs?

 

The output of the logfile:

 

<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="

http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost.dk:8061/schemas/ows/1.1.0

/owsAll.xsd">

  <ows:Exception exceptionCode="OperationProcessingFailed" locator="CreateStoredQuery">

    <ows:ExceptionText>Error validating stored query

org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 647; The markup in the document following the root element must be well-formed.

The markup in the document following the root element must be well-formed.</ows:ExceptionText>

  </ows:Exception>

</ows:ExceptionReport>

 

I have tried to validate the xml in notepad ++ (using the XML Tools plugin) and it validates fine.

Regards and happy holidaysJ

Jonas

 

Jonas Nygaard Pedersen │ IT-udvikler DAD – SDFE Tel. 7254 5510 [hidden email]

 



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users