<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>I had the same problem, and you have two options to solve it. Because is a field order problem.</span></div><div><span>Check with pgadmin how your fields are orderer, you have first name and then the_geom, so tinyows doesn't except anything after the_geom. What you have to do is delete the name field and create it again so it will be after the_geom, with that it works for me.</span></div><div><br><span></span></div><div><span>Or you can try this script, but not always work:</span></div><div><br><span></span></div><div><span>/**<br> * @requires OpenLayers/Strategy.js<br> */<br><br>/**<br> * Allow to force the ordering of attributes before saving<br> *<br> * @class<br> */<br>OpenLayers.Strategy.SaveAttrOrder =<br> OpenLayers.Class(OpenLayers.Strategy,<br>{<br><br>
/**<br> * Order of attributes to save.<br> *<br> * Only the attributes listed here will be saved!<br> *<br> * @type {Array.<string>}<br> */<br> order: [],<br><br> /**<br> * Strategy to communicate with for save operation<br> *<br> * @type {OpenLayers.Strategy.Save}<br> */<br> saveStrategy: null,<br><br> /**<br> * APIMethod: activate<br> * Activate the strategy. Register any listeners, do appropriate setup.<br> *<br> * Returns:<br> * {Boolean} The strategy was successfully activated.<br> */<br> activate: function() {<br> var activated = OpenLayers.Strategy.prototype.activate.call(this);<br> if (activated) {<br>
this.saveStrategy.events.on({<br> start: this.beforeSave,<br> scope: this<br> });<br> }<br> return activated;<br> },<br><br> /**<br> * APIMethod: deactivate<br> * Deactivate the strategy. Unregister any listeners, do appropriate<br> * tear-down.<br> *<br> * Returns:<br> * {Boolean} The strategy was successfully deactivated.<br> */<br> deactivate: function() {<br> var deactivated = OpenLayers.Strategy.prototype.deactivate.call(this);<br> if(deactivated) {<br> this.saveStrategy.events.un({<br> start:
this.beforeSave,<br> scope: this<br> });<br> }<br> return deactivated;<br> },<br><br> beforeSave: function(event) {<br> var features = event.features;<br> features.forEach(dojo.hitch(this, 'reorderFeature'));<br> },<br><br> reorderFeature: function(feature) {<br> var obj = {};<br> this.order.forEach(<br> function(attr) {<br> if (feature.attributes.hasOwnProperty(attr)) {<br> obj[attr] = feature.attributes[attr];<br> }<br> });<br> feature.attributes = obj;<br>
}</span></div><div><br><span></span></div><div><br><span></span></div><div><br><span></span></div><div><span>Hope this help<br></span></div><div><br></div> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight: bold;">De:</span></b> Jessica Lapointe <jlapointe@mapgears.com><br> <b><span style="font-weight: bold;">Para:</span></b> tinyows-users@lists.maptools.org <br> <b><span style="font-weight: bold;">Enviado:</span></b> viernes, 2 de diciembre de 2011 16:41<br> <b><span style="font-weight: bold;">Asunto:</span></b> [TinyOWS-users] Problem inserting new features<br> </font> <br>Hello,<br>I'm having trouble in inserting new features in my db. In fact I have<br>the same problem as described in there:<br><a
href="http://lists.maptools.org/pipermail/tinyows-users/2010-November/000230.html" target="_blank">http://lists.maptools.org/pipermail/tinyows-users/2010-November/000230.html</a><br>I use openlayers 2.11 and tinyows trunk revision 615.<br><br>I'm able to update and delete data with no problem. If I insert simple<br>features containing only geometry it also works. But if my new feature<br>has data, my xml response in firebug will be "XML request isn't<br>valid". Tinyows' log says :<br><br>[Fri Dec 2 14:30:11 2011] [ERROR] Element '{<a href="http://127.0.0.1/" target="_blank" >http://127.0.0.1/</a>}name':<br>This element is not expected.<br><br>[Fri Dec 2 14:30:11 2011] [ERROR] XML request isn't valid<br><br>The xml sent to tinyows is the following:<br><br><wfs:Transaction xmlns:wfs="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>" service="WFS"<br>version="1.0.0" xsi:schemaLocation="<a
href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a><br><a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" target="_blank">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a>"<br>xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><br><wfs:Insert><br><feature:popplace xmlns:feature="<a href="http://127.0.0.1/" target="_blank" >http://127.0.0.1/</a>"><br><feature:the_geom><br><gml:Point xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" srsName="EPSG:4326"><br><gml:coordinates decimal="." cs="," ts="<br>">-45.925780534744,-11.97656750679</gml:coordinates><br></gml:Point><br></feature:the_geom><br><feature:name>test</feature:name><br></feature:popplace><br></wfs:Insert><br></wfs:Transaction><br><br>Any help
would be appreciated.<br>_______________________________________________<br>TinyOWS-users mailing list<br><a ymailto="mailto:TinyOWS-users@lists.maptools.org" href="mailto:TinyOWS-users@lists.maptools.org">TinyOWS-users@lists.maptools.org</a><br><a href="http://lists.maptools.org/mailman/listinfo/tinyows-users" target="_blank">http://lists.maptools.org/mailman/listinfo/tinyows-users</a><br><br><br> </div> </div> </div></body></html>