| I added a WFS-NG data source pointing to an ArcGIS WFS service, dutifully added a few feature types, and started making WFS requests, such as:
However, the POST request (I set prefer POST over GET since ArcGIS objects to the use of plus sign in lieu of %20 when URL-encoding spaces) that GeoServer sent lacked the BBOX/PropertyName element.
2019-05-08 16:40:21,331 DEBUG [org.geotools.data.wfs.requests] - Encoded GET_FEATURE request: <?xml version="1.0" encoding="UTF-8"?><wfs:GetFeature xmlns:SLIP_Public_Services_Farming_WFS="https:services.slip.wa.gov.au:443/arcgis/services/SLIP_Public_Services/Farming_WFS/MapServer/WFSServer" xmlns:xs="http: xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xlink="http://www.w3.org/1999/xlink" handle="GeoTools 20-SNAPSHOT(62662e524ea61f01428d6a7b26a1c7690495ec14) WFS 1.1.0 DataStore @isenbrant#2" maxFeatures="1000000" outputFormat="text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0" resultType="hits" service="WFS" version="1.1.0">
<wfs:Query srsName="urn:ogc:def:crs:EPSG:6.9:3857" typeName="SLIP_Public_Services_Farming_WFS:Land_Capability_-_Vineyards__DPIRD-034_">
<wfs:PropertyName>objectid</wfs:PropertyName>
<wfs:PropertyName>decode</wfs:PropertyName>
<wfs:PropertyName>lc_vines_c</wfs:PropertyName>
<wfs:PropertyName>id</wfs:PropertyName>
<wfs:PropertyName>shape</wfs:PropertyName>
<wfs:PropertyName>st_area_shape_</wfs:PropertyName>
<wfs:PropertyName>st_length_shape_</wfs:PropertyName>
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName/>
<gml:Envelope srsDimension="2" srsName="http:>
<gml:lowerCorner>12702086 -4182198,</gml:lowerCorner>
<gml:upperCorner>13719898 -3205475</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
Filling in the property name results in a successful response from ArcGIS:
curl -XPOST "https:\
--header "Content-Type:text/xml"\
--data '<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature xmlns:SLIP_Public_Services_Farming_WFS="https:services.slip.wa.gov.au:443/arcgis/services/SLIP_Public_Services/Farming_WFS/MapServer/WFSServer"
xmlns:xs="http:
xmlns:wfs="http:
xmlns:gml="http:
xmlns:ogc="http:
xmlns:ows="http:
xmlns:xlink="http: handle="GeoTools 20-SNAPSHOT(62662e524ea61f01428d6a7b26a1c7690495ec14) WFS 1.1.0 DataStore @isenbrant#2" maxFeatures="3"
outputFormat="text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0"
resultType="hits"
service="WFS"
version="1.1.0">
<wfs:Query srsName="urn:ogc:def:crs:EPSG:6.9:3857" typeName="SLIP_Public_Services_Farming_WFS:Land_Capability_-_Vineyards__DPIRD-034_">
<wfs:PropertyName>objectid</wfs:PropertyName>
<wfs:PropertyName>decode</wfs:PropertyName>
<wfs:PropertyName>lc_vines_c</wfs:PropertyName>
<wfs:PropertyName>id</wfs:PropertyName>
<wfs:PropertyName>shape</wfs:PropertyName>
<wfs:PropertyName>st_area_shape_</wfs:PropertyName>
<wfs:PropertyName>st_length_shape_</wfs:PropertyName>
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>shape</ogc:PropertyName>
<gml:Envelope srsDimension="2" srsName="http:>
<gml:lowerCorner>12702086 -4182198,</gml:lowerCorner>
<gml:upperCorner>13719898 -3205475</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>'
After instrumenting GeoServer 2.14, it turned out that the BaseFeatureKvpRequestReader class handleBBOX method does not set propertyName with the default geometry of the feature type; consequently, when the POST request is built, the PropertyName element is left blank, as in the BBOXImpl class the e1 _expression_ is an empty string. I replicated the issue on the current master branch as well. |