Bug report #17872

WFS 2.0.0 DescribeFeatureType : TypeNames vs TypeName

Added by dr - almost 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Web Services clients/WFS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25767

Description

Only TypeNames should be supported in WFS 2.0 but QGIS WFS provider sends TypeName and WFS 2.0 layer cannot be added onto the map.

Associated revisions

Revision ccb4c80f
Added by Alessandro Pasotti almost 7 years ago

[bugfix][wfs] Expand support for 2.0.0 TYPENAMES

Fixes #17872 - WFS 2.0.0 DescribeFeatureType : TypeNames vs TypeName

This PR introduces the plural form of TYPENAME for
2.0.0 WFS servers, with some additional logic to
allow for 2.0.0 servers that only support TYPENAME
for DescribeFeatureType: in this case, the singular
form is also tried in case the plural one fails.

There is still some work to do for transactional
support but at least the read-only client part
should now be ok.

Tests have been added to check that:

- TYPENAME form still works with old 2.0.0
- TYPENAMES form works with compliant 2.0.0
- choice geometry types are handled by calling
GetFeature and examining the result

Revision 2330b7fc
Added by Even Rouault over 6 years ago

[WFS provider] Handle buggy servers that require plural form TYPENAMES for DescribeFeatureType (fixes #18882, refs #17872)

Some servers like http://geoportal.samregion.ru/wfs12 return an
error when issuing a REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAME=...
query, which is the conformant way
They expect the plural form TYPENAMES to be passed
As they return an exception when being provided with the singular form,
we can automate the retry with TYPENAMES.

Revision 839de2e2
Added by Even Rouault over 6 years ago

Merge pull request #7057 from rouault/fix_18882_alternate

[WFS provider] Revert to using singular TYPENAME keyword for WFS 2.0 DescribeFeatureType (fixes #18882, refs #17872)

History

#1 Updated by Alessandro Pasotti almost 7 years ago

  • Assignee set to Alessandro Pasotti

Can you please provide the URL of the failing WFS endpoint?

#2 Updated by dr - almost 7 years ago

I've faced with this issue on the following service: http://geoportal.samregion.ru/wfs12

#3 Updated by Alessandro Pasotti almost 7 years ago

  • Status changed from Open to Feedback
  • Priority changed from High to Normal

Ok, thanks for attaching the test endpoint, here are my findings:

1. WFS client 2.0.0 in QGIS client is NOT fully implemented (transactions for example are not)
2. the example server is flawed: in DescribeFeatureType 2.0.0 request the parameter TYPENAME is not plural but singular: http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#147 but http://geoportal.samregion.ru/wfs12?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAME=EC_1058_33
3. the example server is buggy for an additional reason: if called without TYPENAME it should return all typenames instead of an error

I think we should close this ticket, and instead open a feature request for a complete WFS 2.0.0 implementation in the client, but that would be a complete different story and it will probably need some funding.

#4 Updated by dr - almost 7 years ago

It looks like OGC WFS doc is inconsistent. If you look at the next section: http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#148, it says: "The typeNames parameter encodes the names of one or more features types that shall be described by the DescribeFeatureType operation." From GeoServer docs http://docs.geoserver.org/stable/en/user/services/wfs/basics.html: "WFS 2.0.0 ... also changed typeName to typeNames although GeoServer will accept either." So it seems that TYPENAME should be TYPENAMEs for WFS 2.0.0.

#5 Updated by Alessandro Pasotti almost 7 years ago

Yes, but the XML example also use the singular: http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#146
Note that GeoServer (that IIRC is the reference implementation) also uses the singular form:
https://demo.geo-solutions.it/geoserver/tiger/ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=tiger_roads

#6 Updated by dr - almost 7 years ago

I think that GeoServer instance which you are provide is old. TypeName issue was fixed at GeoServer recently (Nov 22, 2017): https://github.com/geoserver/geoserver/commit/025c34b3bdd626af3ecd96392abc2a136312ccf8

#7 Updated by Alessandro Pasotti almost 7 years ago

  • Status changed from Feedback to In Progress
  • Pull Request or Patch supplied changed from No to Yes

#8 Updated by Anonymous almost 7 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#9 Updated by dr - almost 7 years ago

Thanks!

#10 Updated by Alessandro Pasotti almost 7 years ago

Please give it a try, the more tests we can do the better.

#11 Updated by dr - almost 7 years ago

Thanks again, now it works flawlessly.

#12 Updated by Alessandro Pasotti almost 7 years ago

Thank you for reporting the bug and thanks to all the sponsors and donors for allowing another bugfixing round!
QGIS 3 will be a killer application!

#13 Updated by Giovanni Manghi almost 7 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF