qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.47k stars 2.99k forks source link

WFS-T client sends columns in the wrong order #22401

Closed qgib closed 5 years ago

qgib commented 8 years ago

Author Name: dr - (dr -) Original Redmine Issue: 14420 Affected QGIS version: master Redmine category:web_services_clients/wfs


QGIS uses DescribeFeatureType request for WFS layers and in my case DescribeFeatureType response is:

<?xml version='1.0' encoding='UTF-8'?>
<xs:schema targetNamespace='http://nextgis.org/sf' xmlns:rk='http://nextgis.org/sf' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:gml='http://www.opengis.net/gml' elementFormDefault='qualified' version='1.0'>
<xs:import namespace='http://www.opengis.net/gml' schemaLocation='http://schemas.opengis.net/gml/2.1.2/feature.xsd'/>
<xs:element name='bogs' type='rk:bogsType' substitutionGroup='gml:_Feature' />
<xs:complexType name='bogsType'>
 <xs:complexContent>
  <xs:extension base='gml:AbstractFeatureType'>
   <xs:sequence>
    <xs:element name ='wkb_geometry' type='gml:PointPropertyType' nillable='true' minOccurs='0' maxOccurs='1'/>
    <xs:element name ='name' type='string' nillable='true' minOccurs='0' maxOccurs='1'/>
    <xs:element name ='desc' type='string' nillable='true' minOccurs='0' maxOccurs='1'/>
    <xs:element name ='layer_id' type='int' nillable='true' minOccurs='0' maxOccurs='1'/>
   </xs:sequence>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>
</xs:schema>

As you can see this response contains section @xs:sequence@ with @wkb_geometry@ element if first place. But when I add new feature and trying to save it - QGIS sends the following request payload:

<Transaction xmlns="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rk="http://nextgis.org/sf" version="1.0.0" service="WFS" xsi:schemaLocation="http://nextgis.org/sf http://map.rostmuseum2.ru/cgi-bin/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=rk:bogs&amp;SRSNAME=EPSG:4326" xmlns:gml="http://www.opengis.net/gml"><Insert xmlns="http://www.opengis.net/wfs">
<bogs xmlns="http://nextgis.org/sf">
    <name xmlns="http://nextgis.org/sf">1</name>
    <desc xmlns="http://nextgis.org/sf">2</desc>
    <layer_id xmlns="http://nextgis.org/sf">3</layer_id>
    <wkb_geometry xmlns="http://nextgis.org/sf"><gml:Point srsName="EPSG:4326"><gml:coordinates cs="," ts=" ">38.43048436256268019,57.03603754838613327</gml:coordinates></gml:Point></wkb_geometry>
</bogs>
</Insert>
</Transaction>

In this XML document - @wkb_geometry@ element is last, but have to be on ther first place of the sequence and I get an error from WFS-server (TinyOWS in my case):

[Fri Mar  4 13:34:31 2016] [ERROR] Element '{http://nextgis.org/sf}wkb_geometry': This element is not expected.
[Fri Mar  4 13:34:31 2016] [ERROR] XML request isn't valid
qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


There have been big changes in the wfs client in the last days in master, please give it a try and report back.


qgib commented 8 years ago

Author Name: dr - (dr -)


Issue still exists. Trying on latest master:

[Mon Apr 11 00:00:24 2016] [ERROR] Element '{http://nextgis.org/sf}wkb_geometry': This element is not expected.
qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


Still true in 2.18/master?


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


Any feedback about this issue? thanks!

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback, please reopen if necessary.