Client: OpenLayers / Server: Geoserver
When I update a WFS Element,
JAVASCRIPT:
element.feature.attributes.ENAME = "Mystring";
saveStrategy.save();
HTTP-POST:
<wfs:Property>
<wfs:Name>ENAME</wfs:Name>
<wfs:Value>MyString</wfs:Value>
</wfs:Property>
some features of Type String do not get fully updated, only the first letter ends up in the WFS layer.
<wfs:FeatureCollection ...>
...
<Project:ENAME>
M
</Project:ENAME>
</wfs:FeatureCollection>
//only M ends up on the server, not Mystring as expected
the respective line in the logfile (catalina.out) says:
name = ENAME
value = Mystringproperty[0]:
strangely, the attached property[0] is on all attributes, not only on the one which is reduced to its first letter, but also on some strings that do not get shortened as well as some integers.
I would expect the type of the respective feature to be something like String[1]
, but as far as I can see the Type System, there are no length attributes to Strings.
Who knows what I can do?
UPDATE
When I change the value of any feature's attribute (ENAME) with OpenJump
and upload the changed data, my application shows the feature correctly, which means, the geoserver itself CAN store a string longer than 1 in the respective attribute.
However, everytime I make an update via OpenLayers, regardless on which feature, any other feature's ENAME attribute gets shortened (like from 'MyString' to 'M'), even if it was a totally different feature that was updated on OpenLayers.
The log (catalina.out) says NOTHING about this perfidious update operation.
UPDATE
Content of the Firebug Post TAB, Content of the respective Log Section:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Update typeName="feature:Graeber" xmlns:feature="myserver.de/ah_neu">
<wfs:Property>
<wfs:Name>the_geom</wfs:Name>
<wfs:Value>
<gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:31466">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">363261.475316,5770742.697063 363260.253031,5770742.452777 363260.011425,5770743.66165201 363261.233711,5770743.90593801 363261.475316,5770742.697063</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
</wfs:Value>
</wfs:Property>
<wfs:Property>
<wfs:Name>LAYER</wfs:Name>
<wfs:Value>Grab</wfs:Value>
</wfs:Property>
<wfs:Property>
<wfs:Name>GRABNAME</wfs:Name>
<wfs:Value>Huber</wfs:Value>
</wfs:Property>
<wfs:Name>NUTZENDE</wfs:Name>
<wfs:Value>2023-07-14</wfs:Value>
</wfs:Property>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:FeatureId fid="Graeber.203"></ogc:FeatureId>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>
2015-01-20 17:01:00,671 INFO [geoserver.wfs] -
Request: transaction
service = WFS
version = 1.1.0
baseUrl = http://myserver.de:80/geoserver/
group[0] = wfs:update=net.opengis.wfs.impl.UpdateElementTypeImpl@53a7e8d6 (filter: [ Graeber.203 ], handle: null, inputFormat: <unset>, srsName: null, typeName: {myserver.de/ah_neu}Graeber)
update[0]:
property[0]:
name = the_geom
value = MULTIPOLYGON (((363248.39039900305 5770772.417071999, 363249.21531199943 5770770.058744, 363248.0047730003 5770769.655668, 363248.0010000006 5770769.667, 363247.17900000024 5770772.016999999, 363248.39039900305 5770772.417071999)))property[0]:
name = LAYER
value = Grabproperty[0]:
name = GRABNAME
value = Huberproperty[0]:
name = NUTZENDE
value = 2023-07-14
filter = [ Graeber.203 ]
inputFormat = x-application/gml:3
typeName = {myserver.de/ah_neu}Graeber
releaseAction = ALL
STILL not solved
WFS Layer:
<xsd:schema elementFormDefault="qualified" targetNamespace="myserver.de/ah_neu">
<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://myserver.de/geoserver/schemas/gml/2.1.2/feature.xsd"/>
<xsd:complexType name="GraeberType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true" type="gml:MultiPolygonPropertyType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="LAYER" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="10" minOccurs="0" name="GRABNAME" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="NUTZENDE" nillable="true" type="xsd:dateTime"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="Graeber" substitutionGroup="gml:_Feature" type="ah_neu:GraeberType"/>
</xsd:schema>
Javascript definition:
layer_selectable = new OpenLayers.Layer.Vector("WFS", {
strategies : [new OpenLayers.Strategy.BBOX(), saveStrategy],
styleMap: new OpenLayers.StyleMap({
'default': style,
'select': style_selected }),
protocol : new OpenLayers.Protocol.WFS({
url : geoserver + config.wfs_layer,
version : "1.1.0",
featureType : "Graeber",
featureNS : config.featureNS,
srsName : epsg,
}),
renderers : renderer
//tileOptions: {crossOriginKeyword: 'anonymous'}
});
<xsd:element maxOccurs="1" minOccurs="0" name="ENAME" nillable="true" type="xsd:string"/>