[Geoserver-users] WFS transactionUpdateGeometry QGIS problem

I have a problem when I try to update a multilinestring geometry.
I had the same issue in the past, I thought I had solved it but now it is back again. :frowning:

Setup: geoserver 2.7.1 and a test layer connected to a postgis table.

I connect to the layer in qgis.
I can create a new feature (line), I can update feature attributes but I can't update the geometry of any feature. If I add or move a node I get an error:

Transaction failed
org.geoserver.wfs.WFSTransactionException: Update error: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry

I enabled geoserver debug log and the xml transaction sent from qgis is the following:

<Transaction xmlns="http://www.opengis.net/wfs&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; version="1.0.0" xmlns:ws1="http://****.***"
service="WFS" xmlns:wfs="http://www.opengis.net/wfs&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
xsi:schemaLocation="http://****.*** http://*****.***:8080/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=ws1:test&amp;SRSNAME=EPSG:4326&amp;username=user1&amp;password=***" xmlns:gml="http://www.opengis.net/gml">
   <Update xmlns="http://www.opengis.net/wfs&quot; typeName="ws1:test">
   <Property xmlns="http://www.opengis.net/wfs&quot;&gt;
    <Name xmlns="http://www.opengis.net/wfs&quot;&gt;geom&lt;/Name&gt;
    <Value xmlns="http://www.opengis.net/wfs&quot;&gt;
      <gml:MultiLineString srsName="EPSG:4326">
       <gml:lineStringMember>
        <gml:LineString>
          <gml:coordinates cs="," ts=" ">8.00003043999999974,44.23241551000000271 8.00578959672930246,44.17149441442651892 8.06909135999999982,44.16719473999999934</gml:coordinates>
        </gml:LineString>
      </gml:lineStringMember>
      </gml:MultiLineString>
    </Value>
   </Property>
   <Filter xmlns="http://www.opengis.net/ogc&quot;&gt;
        <FeatureId xmlns="http://www.opengis.net/ogc&quot; fid="test.4"/>
   </Filter>
   </Update>
</Transaction>

I tried to execute it in the demo requests and got the same error.

So I compared the example xml request created by the demo with the one created by qgis and the only relevant difference is in the xmlns used in any tags or declared in the transaction tag.

So I started from a working xml request (based on the one generated by the demo) and modified the tags from the outer tag to transform it to an xml similar to the qgis-generated one. First I modified the transaction tag followed by the Update tag and so on.
The transactions were successful up to when I used the following xml:

<Transaction xmlns="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0"
xmlns:ws1="http://*****.***"
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation="http://*****.*** http://******.***:8080/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=ws1:test&amp;SRSNAME=EPSG:4326&amp;username=user1&amp;password=******">
   <Update xmlns="http://www.opengis.net/wfs&quot; typeName="ws1:test">
    <Property xmlns="http://www.opengis.net/wfs&quot;&gt;
      <Name xmlns="http://www.opengis.net/wfs&quot;&gt;geom&lt;/Name&gt;
      <Value xmlns="http://www.opengis.net/wfs&quot;&gt;
       <gml:MultiLineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
        <gml:lineStringMember>
          <gml:LineString>
           <gml:coordinates>8.00003043999999974,44.23241551000000271 8.00578959672930246,44.17149441442651892 8.06909135999999982,44.16719473999999934</gml:coordinates>
          </gml:LineString>
        </gml:lineStringMember>
       </gml:MultiLineString>
      </Value>
    </Property>
    <ogc:Filter>
      <ogc:FeatureId fid="test.4"/>
    </ogc:Filter>
   </Update>
   </Transaction>

The problem seems to be in the Value tag.
If the xml has <wfs:Value>...</wfs:Value> it works.
If I change it to <Value xmlns="http://www.opengis.net/wfs&quot;&gt;\.\.\.&lt;/Value&gt; I get the aforementioned error.

Any clue on what's wrong here?

thank you
  maxx
  

Il 11/27/2015 01:05 PM, emmexx scrisse:

The problem seems to be in the Value tag.
If the xml has <wfs:Value>...</wfs:Value> it works.
If I change it to <Value xmlns="http://www.opengis.net/wfs&quot;&gt;\.\.\.&lt;/Value&gt;
I get the aforementioned error.

I asked the same question on the qgis users mailing list and received an answer that hints that the problem is in geoserver.

Can anybody tell me if I should file a bug?

Thank you
  maxx

On Tue, Dec 1, 2015 at 9:39 PM, emmexx <emmexx@anonymised.com> wrote:

Il 11/27/2015 01:05 PM, emmexx scrisse:
> The problem seems to be in the Value tag.
> If the xml has <wfs:Value>...</wfs:Value> it works.
> If I change it to <Value xmlns="http://www.opengis.net/wfs&quot;&gt;\.\.\.&lt;/Value&gt;
> I get the aforementioned error.

I asked the same question on the qgis users mailing list and received an
answer that hints that the problem is in geoserver.

Can anybody tell me if I should file a bug?

Yes, go ahead. The XML you have is pretty dumb (repeating the default
namespace at every tag
is really overkill) but it looks like it migh be valid. More investigation
needed, but I have no time
to work on it now.

So yes, open a ticket with all the details required to reproduce the issue
(if you can do include
a sample dataset you're trying to modify too)

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

*Geosolutions' Winter Holidays from 24/12 to 6/1*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Il 12/09/2015 06:07 PM, Andrea Aime scrisse:

Yes, go ahead. The XML you have is pretty dumb (repeating the default
namespace at every tag
is really overkill) but it looks like it migh be valid. More
investigation needed, but I have no time
to work on it now.

So yes, open a ticket with all the details required to reproduce the
issue (if you can do include
a sample dataset you're trying to modify too)

I created the ticket:

https://osgeo-org.atlassian.net/browse/GEOS-7357

bye
  maxx