planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

Error publishing edits back to GeoServer #136

Open eshon opened 10 years ago

eshon commented 10 years ago

Is this a bug or if not, why does this happen? (See the edit above North America...)

screen shot 2014-04-12 at 3 56 44 pm screen shot 2014-04-12 at 3 56 24 pm

ScottEvil commented 10 years ago

@eshon this is a bug in QGIS itself. The WFS authentication is broken in 2.2. There is a fix that they're discussing getting into 2.2.1 patch release the Rene-Luc put in recently. The QGIS bug report is here: http://hub.qgis.org/issues/9234

pauliusl commented 9 years ago

Same problem on QGIS 2.4. I published shp file to geoserver through OpenGeo Explorer and then added it's layer to QGIS project with OpenGeo Explorer tool: "Add to curent QGIS project". it was added successfully. But if I try save any changes - getting same message as in previuos post. Tried to add same layer through WFS connection. Changes was saved successfully. So tried to find the difference between those two layers (one added from OpenGeo explorer, other from WFS connection). Where was the difference in url: OpenGeo Exploerer layer: http://host:8089/geoserver/wfs?srsname=EPSG:3346&typename=PR1:gatviu_ribos&version=1.0.0&request=GetFeature&service=WFS WFS conection layer: http://host:8089/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=PR1:gatviu_ribos&SRSNAME=EPSG:3346&username=admin&password=geoserver

if parameter service=WFS is at the end - in geoserver I got ows exeption. But if it is just after ? everything works fine. So I opened QGIS project with text editor and changed the url for layer - after that it works.

So I think the problem is due to how OpenGeo Explorer generates the link who couses problems to geoserver. One workaround would be to change the url generation.

volaya commented 9 years ago

The order of the parameters should not affect how it works. However, the url generated by the OpenGeo explorer is missing the credentials (no 'password' and 'username' parameters), which is probably the cause of the problem.

I have just pushed a change which modifies how uris are created, adding also the credentials.

Notice that, although it might solve the problem in this case, it might not be a bullet-proof solution, since it uses the credentials for accessing the GeoServer REST API (the ones used by the OpenGeo plugin, which are the ones that the plugin itself knows), but for accessing the WFS service it might be necessary to use different credentials (unknown to the plugin)

pauliusl commented 9 years ago

Looks like it is due to request argument name in lowercase (request): http://host:8089/geoserver/wfs?srsname=EPSG:3346&typename=BENDRAS:linija&version=1.0.0&request=GetFeature&service=WFS - does not work.

If I edit the project with notepad and change it to uppercase ( REQUEST ): http://host:8089/geoserver/wfs?srsname=EPSG:3346&typename=BENDRAS:linija&version=1.0.0&REQUEST=GetFeature&service=WFS - it work and is no need for username and password parameters.

Maybe it is QGIS problem as entering both url in web browser works and returns good response.

in qgis trying commit features with request in lower case gives the following message: Commit errors: ERROR: 1 geometries not changed.

          Provider errors:
              WFS service exception:
                  java.lang.IllegalArgumentException: argument type mismatch
            argument type mismatch

QGIS 2.6.0 x86, GeoServer 2.6.0 on windows server x64

RadekHavelka commented 6 years ago

I know this is very old thread, but I'm having the same problem in QGis 3.0 version againts my Geoserver 2.7.0 ... wouldn't it be good, if both tools simply do not crash with some superweird JAVA error, but instead said something like "missing credentials" or something like that? I have no idea what is wrong and why it doesnt work :(