[OpenLayers-Users] WFS-T update problem with namespaces

Andrea Aime aaime at openplans.org
Wed Jun 4 14:09:24 EDT 2008


2StepForward ha scritto:
> Hello List,
> 
> if have read many posts about WFS-T transaction and update/delete features,
> but can't solve my problem.
> If i try the transaction_update demo request in GeoServer demo with some
> manipulations to my featuretype, everything works fine.
> 
> Like this:
> 
> <wfs:Transaction service="WFS" version="1.0.0"
>   xmlns:WFS="http://www.own-namespace.de/wfs"      -> this is the import of
> my own namespace from GS
>   xmlns:ogc="http://www.opengis.net/ogc"
>   xmlns:wfs="http://www.opengis.net/wfs">
>   xmlns:gml="http://www.opengis.net/gml"
>   <wfs:Update typeName="WFS:info">
>     <wfs:Property>
>       <wfs:Name>the_geom</wfs:Name>
>       <wfs:Value>
>       <gml:Point srsName="EPSG:23032">
>       <gml:coordinates decimal="." cs="," ts="
> ">662043.2646366811,5798981.532771344</gml:coordinates>
>       </gml:Point>
>       </wfs:Value>
>     </wfs:Property>
>     <ogc:Filter>
>       <ogc:FeatureId fid="info.1"/>
>     </ogc:Filter>
>   </wfs:Update>
> </wfs:Transaction>
> 
> But if I take a commit of my WFS layer and that feature type, than i can
> sniff these xml transaction code:
> 
> <wfs:Transaction version="1.0.0" service="WFS"
> xmlns:wfs="http://www.opengis.net/wfs">
>  <wfs:Update typeName="WFS:em">
>   <wfs:Property>
>    <wfs:Name>the_geom</wfs:Name>
>    <wfs:Value>
>     <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:23032">
>     <gml:coordinates decimal="." cs="," ts="
> ">662043.2646366811,5798981.532771344</gml:coordinates>
>     </gml:Point>
>    </wfs:Value>
>   </wfs:Property>
>    <ogc:Filter>
>      <ogc:FeatureId fid="info.1"/>
>    </ogc:Filter>
>  </wfs:Update>
> </wfs:Transaction>
> 
> and i get, I think this might be right, a error window which said "WFS is
> not bind to a namespace".
> If I think right, it meens the WFS namespace prefix of my featuretype which
> should bind to the:
> 
> xmlns:WFS="http://www.own-namespace.de/wfs"
> 
> namespace definition. But there isn't any definition of my own in GS defined
> namespace.

Yeah, the error comes up from Xerces-J during the xml validation, it
should be something like the following (I used another layer):

Invalid request
UndeclaredPrefix: Cannot resolve 'topp:tasmania_roads' as a QName: the 
prefix 'topp' is not declared.
cvc-attribute.3: The value 'topp:tasmania_roads' of attribute 'typeName' 
on element 'wfs:Update' is not valid with respect to its type.

The problem is that typeName is an xs:QName, and its namespace must
be declared in order for the XML to be schema compliant.

I believe you'll need to open a ticket with OL. In the meantime, the way
to make the request work anyways, is to disable XML validation in
GeoServer: disable "strict cite compliance" in wfs configuraton or
post your requests to http://host:port/geoserver/wfs?strict=false

Of course when you do that the validation goes bye bye and the parser
is left at your mercy, if you submit invalid xml it will just ignore
the xml parts it does not understand, making debugging of hand
made requests harder.

Cheers
Andrea



More information about the Users mailing list