<!DOCTYPE html><html><head><title></title><style type="text/css">#qt P{margin-top:0px;margin-bottom:0px;}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi,<br></div><div><br></div><div>Are you able to log the SQL sent to Postgres and see the difference between the GET and POST request? Or maybe the query doesn't get to the database at all looking at that error. <br></div><div>It looks like the filter is failing to convert to a Postgres query. <br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div>On Fri, Oct 6, 2023, at 4:45 PM, Froehlich, Dominik via MapServer-users wrote:<br></div><blockquote type="cite" id="qt" style=""><div id="qt-divtagdefaultwrapper" style="font-size:12pt;color:rgb(0, 0, 0);font-family:Calibri, Helvetica, sans-serif;" dir="ltr"><div>Dear *<br></div><div style="color:rgb(0, 0, 0);"><div><div id="qt-divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0, 0, 0);font-family:Calibri, Helvetica, sans-serif;"><div><div><br></div><div><br></div><div>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></div><div> <br></div><div> https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities<br></div><div> <br></div><div> 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></div><div> <br></div><div> 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></div><div> <br></div><div> wheras "strassenname" is the street name and "hausnummer" the house number.<br></div><div> The GET call will return one matching feature as expected.<br></div><div> <br></div><div> <br></div><div> The same request as POST to https://geoportal.freiburg.de/wfs/gdm_address/gdm_address<br></div><div> <br></div><div> <span class="font" 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></div><div> <span class="font" 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></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Parameter name="strassenname">fehren</Parameter></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Parameter name="hausnummer">12</Parameter></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </StoredQuery></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"></GetFeature></span><br></div><div> <br></div><div> however will only return <br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"><?xml version='1.0' encoding="UTF-8" ?></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"><wfs:FeatureCollection</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:ms="http://mapserver.gis.umn.edu/mapserver"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:gml="http://www.opengis.net/gml/3.2"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:wfs="http://www.opengis.net/wfs/2.0"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</span><br></div><div> <span class="font" 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&VERSION=2.0.0&REQUEST=DescribeFeatureType&TYPENAME=ms:addresses&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></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> timeStamp="2023-10-05T16:10:00" numberMatched="unknown" numberReturned="0"></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"></wfs:FeatureCollection></span><br></div><div> <br></div><div> <br></div><div> Strange enough, it will also log some weired error at DEBUG 5:<br></div><div> <br></div><div> <span class="font" 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></div><div> <span class="font" 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></div><div> <span class="font" 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></div><div> <span class="font" 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></div><div> <br></div><div> <br></div><div> The stored query itself is defined as<br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"><?xml version="1.0" encoding="UTF-8"?></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"><StoredQueryDescription xmlns:xs="https://www.w3.org/2001/XMLSchema"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:gml="https://www.opengis.net/gml/3.2"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> id="search_street_nr"></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Title>Straßen- und Hausnummernsuche</Title></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Abstract>Suche nach einem Straßenname und einer Hausnummer im Adress-WFS</Abstract></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Parameter name="strassenname" type="string"/></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Parameter name="hausnummer" type="string"/></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <QueryExpressionText isPrivate="false"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:ms="https://geoportal.freiburg.de/wfs/gdm_address/gdm_address_gaz"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> returnFeatureTypes="ms:addresses"></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Query </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> xmlns:ogc="https://www.opengis.net/ogc"</span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> typeNames="ms:addresses"></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:Filter></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:AND></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="?" escape="\"></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:ValueReference>ms:strassenname</ogc:ValueReference></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Literal>*${strassenname}*</Literal></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:PropertyIsLike></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:PropertyIsEqualTo matchCase="false" wildCard="*" singleChar="?" escape="\"></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:ValueReference>ms:hausnummer</ogc:ValueReference></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Literal>${hausnummer}</Literal></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:PropertyIsEqualTo></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:PropertyIsEqualTo matchCase="false"></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:ValueReference>ms:hausnummernzusatz</ogc:ValueReference></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <Literal></Literal></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:PropertyIsEqualTo></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:AND></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:Filter></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:sortBy></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:SortProperty></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:ValueReference>ms:hausnummer</ogc:ValueReference></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> <ogc:SortOrder>ASC</ogc:SortOrder></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:SortProperty></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </ogc:sortBy></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </Query></span><br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"> </QueryExpressionText></span><br></div><div> <br></div><div> <span class="font" style="font-family:Arial, Helvetica, sans-serif;"></StoredQueryDescription></span><br></div><div> <br></div><div> <br></div><div> 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></div><div> <br></div><div> Best,<br></div></div><div><br></div><div>Dominik<br></div><p><br></p><div id="qt-Signature"><br></div></div></div></div></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></body></html>