2

I am using WFS-T in a mobile application to commit changes to a postgis database via geoserver 2.6. I build the http requests myself (not using any framework like geotools or openlayers). I already support wfs1.1.0 and would like to extend to support for 2.0.0.

I am unable to send a successful commit request so far, reading the standard did not help me find the answer, and I found no examples on the web... Here is my post parameters:

<wfs:Transaction version="2.0.0" service="WFS" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xxxxxxx/geoserver/schemas/wfs/2.0/wfs.xsd">
  <wfs:Update typeName="av_dev:CopperCable">
    <wfs:Property>
      <wfs:ValueReference>InsertBy</wfs:ValueReference>
      <wfs:Value>0</wfs:Value>
    </wfs:Property>
    <ogc:Filter>
      <ogc:GmlObjectId gml:id="CopperCable.2" />
    </ogc:Filter>
  </wfs:Update>
</wfs:Transaction>

I am getting this error from geoserver: java.lang.IllegalArgumentException: argument type mismatch

This request works for wfs 1.1.0 if I replace the version number and the "ValueReference" tag with "Name".

What is wrong in my request?

1

This works:

<wfs:Update typeName="av_dev:PointModel" >
    <wfs:Property>
      <wfs:ValueReference>orientation</wfs:ValueReference>
      <wfs:Value>2</wfs:Value>
    </wfs:Property>
    <fes:Filter>
      <fes:ResourceId rid="7" />
    </fes:Filter>
  </wfs:Update>
</wfs:Transaction>

What has changed is the ogc namespace for the filter was replaced with fes (Filter Encoding Specs.) The content of the filter is a "ResourceId" element with a "rid" attribute. In my case the rid attribute contains the id of the feature only whereas the example from the standard document contains the feature type plus the id like this: . (so this is still not clear for me). Also, this working request updates an integer attribute ; I did not manage to update a geometry attribute, so still accepting help.

1

This works:

<wfs:Update typeName="av_dev:PointModel" >
    <wfs:Property>
      <wfs:ValueReference>orientation</wfs:ValueReference>
      <wfs:Value>2</wfs:Value>
    </wfs:Property>
    <fes:Filter>
      <fes:ResourceId rid="7" />
    </fes:Filter>
  </wfs:Update>
</wfs:Transaction>

What has changed is the ogc namespace for the filter was replaced with fes (Filter Encoding Specs.) The content of the filter is a "ResourceId" element with a "rid" attribute. In my case the rid attribute contains the id of the feature only whereas the example from the standard document contains the feature type plus the id like this: <featuretype>.<id> (so this is still not clear for me). Also, this working request updates an integer attribute ; for geometries, I had to check and change the namespaces (including GML namespace).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.