<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
Dear *
<div style="color: rgb(0, 0, 0);">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<div><br>
<br>
I'm stuck for some time experiencing a strange behavoiur with WFS POST requests to stored querys on our mapserver (v.8.0.1/ubuntu 22.04) and can't seem to find anythin helpful in the logs or on the web. The server is public, so you can see for yourselves. To
 describe the issue I'll stick to our address service providing the addresses in Freiburg im Breisgau, Southwest Germany.
<br>
<br>
https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities<br>
<br>
The service is supposed to answer both GET and POST requests. This does work just fine for "normal" GetFeature requests. However, there seems to be an issue with stored queries. E.g. we set up some stored query for searching addresses taking a street name and
 a house number as an argument. It can be easily queried by calling e.g.<br>
<br>
https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS&version=2.0.0&REQUEST=GetFeature&StoredQuery_ID=findeStrasseHnr&strassenname=fehren&hausnummer=12<br>
<br>
wheras "strassenname" is the street name and "hausnummer" the house number.<br>
The GET call will return one matching feature as expected.<br>
<br>
<br>
The same request as POST to https://geoportal.freiburg.de/wfs/gdm_address/gdm_address<br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif"><GetFeature xmlns="http://www.opengis.net/wfs" service="WFS" version="2.0.0" maxFeatures="3" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    <StoredQuery id="findeStrasseHnr" xmlns="http://www.opengis.net/wfs" typeName="ms:addresses" srsName="urn:ogc:def:crs:EPSG::25832" xmlns:ms="http://mapserver.gis.umn.edu/mapserver"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">        <Parameter name="strassenname">fehren</Parameter></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">        <Parameter name="hausnummer">12</Parameter></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    </StoredQuery></span><br>
<span style="font-family:Arial,Helvetica,sans-serif"></GetFeature></span><br>
<br>
however will only return <br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif"><?xml version='1.0' encoding="UTF-8" ?></span><br>
<span style="font-family:Arial,Helvetica,sans-serif"><wfs:FeatureCollection</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   xmlns:gml="http://www.opengis.net/gml/3.2"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   xmlns:wfs="http://www.opengis.net/wfs/2.0"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=ms:addresses&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2
 http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">   timeStamp="2023-10-05T16:10:00" numberMatched="unknown" numberReturned="0"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif"></wfs:FeatureCollection></span><br>
<br>
<br>
Strange enough, it will also log some weired error at DEBUG 5:<br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">[Fri Oct  6 14:59:29 2023].546904 msWFSParseRequest(): WFS post request: <GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="2.0.0" maxFeatures="200" xsi:schemaLocation="http://www.opengis.net/wfs
 http://schemas.opengis.net/wfs/1.1.0/wfs.xsdhttp://www.opengis.net/wfs%20http:/schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><StoredQuery id="findeStrasseHnr" xmlns="http://www.opengis.net/wfs" typeName="ms:addresses"
 srsName="EPSG::25832"><Parameter name="strassenname">fehren</Parameter><Parameter name="hausnummer">12</Parameter></StoredQuery></GetFeature></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">[Fri Oct  6 14:59:29 2023].622878 FLTLayerApplyPlainFilterToLayer(): (("[strassenname]" ~* "^.*feh.*$") AND (([hausnummer] =* 12) AND ("[hausnummernzusatz]" = ""))), rect=399550,5305350,420740,5325690</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">[Fri Oct  6 14:59:29 2023].689509 msPostGISLayerTranslateFilter(): General error message. Translation to native SQL failed.</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">[Fri Oct  6 14:59:30 2023].110714 msQueryByFilter(): No matching record(s) found.[Fri Oct  6 14:59:30 2023].110799 mapserv request processing time (msLoadMap not incl.): 0.564s</span><br>
<br>
<br>
The stored query itself is defined as<br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif"><?xml version="1.0" encoding="UTF-8"?></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif"><StoredQueryDescription xmlns:xs="https://www.w3.org/2001/XMLSchema"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                        xmlns:gml="https://www.opengis.net/gml/3.2"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                        id="search_street_nr"></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">    <Title>Straßen- und Hausnummernsuche</Title></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    <Abstract>Suche nach einem Straßenname und einer Hausnummer im Adress-WFS</Abstract></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    <Parameter name="strassenname" type="string"/></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    <Parameter name="hausnummer" type="string"/></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">    <QueryExpressionText isPrivate="false"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                        language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                        xmlns:ms="https://geoportal.freiburg.de/wfs/gdm_address/gdm_address_gaz"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                        returnFeatureTypes="ms:addresses"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">        <Query </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            xmlns:ogc="https://www.opengis.net/ogc"</span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            typeNames="ms:addresses"></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">            <ogc:Filter></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            <ogc:AND></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="?" escape="\"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <ogc:ValueReference>ms:strassenname</ogc:ValueReference></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <Literal>*${strassenname}*</Literal></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </ogc:PropertyIsLike></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                <ogc:PropertyIsEqualTo matchCase="false" wildCard="*" singleChar="?" escape="\"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <ogc:ValueReference>ms:hausnummer</ogc:ValueReference></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <Literal>${hausnummer}</Literal></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </ogc:PropertyIsEqualTo></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                <ogc:PropertyIsEqualTo matchCase="false"></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <ogc:ValueReference>ms:hausnummernzusatz</ogc:ValueReference></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <Literal></Literal></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </ogc:PropertyIsEqualTo></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">            </ogc:AND></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">            </ogc:Filter></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            </span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            <ogc:sortBy></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                <ogc:SortProperty></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <ogc:ValueReference>ms:hausnummer</ogc:ValueReference></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                    <ogc:SortOrder>ASC</ogc:SortOrder></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">                </ogc:SortProperty></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">            </ogc:sortBy></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif">        </Query></span><br>
<span style="font-family:Arial,Helvetica,sans-serif">    </QueryExpressionText></span><br>
<br>
<span style="font-family:Arial,Helvetica,sans-serif"></StoredQueryDescription></span><br>
<br>
<br>
Am I missing something here or do you have any suggestions for me? I'm grateful for any insights! Please also let me know if you need more details on something else.<br>
<br>
Best,</div>
<div><br>
</div>
<div>Dominik<br>
</div>
<p></p>
<div id="Signature"></div>
</div>
</div>
</div>
</div>
</body>
</html>