<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>&nbsp;* @requires OpenLayers/Strategy.js<br>&nbsp;*/<br><br>/**<br>&nbsp;* Allow to force the ordering of attributes before saving<br>&nbsp;*<br>&nbsp;* @class<br>&nbsp;*/<br>OpenLayers.Strategy.SaveAttrOrder =<br>&nbsp; OpenLayers.Class(OpenLayers.Strategy,<br>{<br><br>&nbsp;
 /**<br>&nbsp;&nbsp; * Order of attributes to save.<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; * Only the attributes listed here will be saved!<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; * @type {Array.&lt;string&gt;}<br>&nbsp;&nbsp; */<br>&nbsp; order: [],<br><br>&nbsp; /**<br>&nbsp;&nbsp; * Strategy to communicate with for save operation<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; * @type {OpenLayers.Strategy.Save}<br>&nbsp;&nbsp; */<br>&nbsp; saveStrategy: null,<br><br>&nbsp; /**<br>&nbsp;&nbsp; * APIMethod: activate<br>&nbsp;&nbsp; * Activate the strategy.&nbsp; Register any listeners, do appropriate setup.<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; * Returns:<br>&nbsp;&nbsp; * {Boolean} The strategy was successfully activated.<br>&nbsp;&nbsp; */<br>&nbsp; activate: function() {<br>&nbsp;&nbsp;&nbsp; var activated = OpenLayers.Strategy.prototype.activate.call(this);<br>&nbsp;&nbsp;&nbsp; if (activated) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 this.saveStrategy.events.on({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start: this.beforeSave,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope: this<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return activated;<br>&nbsp; },<br><br>&nbsp; /**<br>&nbsp;&nbsp; * APIMethod: deactivate<br>&nbsp;&nbsp; * Deactivate the strategy.&nbsp; Unregister any listeners, do appropriate<br>&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp; tear-down.<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; * Returns:<br>&nbsp;&nbsp; * {Boolean} The strategy was successfully deactivated.<br>&nbsp;&nbsp; */<br>&nbsp; deactivate: function() {<br>&nbsp;&nbsp;&nbsp; var deactivated = OpenLayers.Strategy.prototype.deactivate.call(this);<br>&nbsp;&nbsp;&nbsp; if(deactivated) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.saveStrategy.events.un({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start:
 this.beforeSave,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope: this<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return deactivated;<br>&nbsp; },<br><br>&nbsp; beforeSave: function(event) {<br>&nbsp;&nbsp;&nbsp; var features = event.features;<br>&nbsp;&nbsp;&nbsp; features.forEach(dojo.hitch(this, 'reorderFeature'));<br>&nbsp; },<br><br>&nbsp; reorderFeature: function(feature) {<br>&nbsp;&nbsp;&nbsp; var obj = {};<br>&nbsp;&nbsp;&nbsp; this.order.forEach(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function(attr) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (feature.attributes.hasOwnProperty(attr)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj[attr] = feature.attributes[attr];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp; feature.attributes = obj;<br>&nbsp;
 }</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 &lt;jlapointe@mapgears.com&gt;<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&nbsp; 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&nbsp; 2 14:30:11 2011] [ERROR] XML request isn't valid<br><br>The xml sent to tinyows is the following:<br><br>&lt;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>"&gt;<br>&lt;wfs:Insert&gt;<br>&lt;feature:popplace xmlns:feature="<a href="http://127.0.0.1/" target="_blank" >http://127.0.0.1/</a>"&gt;<br>&lt;feature:the_geom&gt;<br>&lt;gml:Point xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" srsName="EPSG:4326"&gt;<br>&lt;gml:coordinates decimal="." cs="," ts="<br>"&gt;-45.925780534744,-11.97656750679&lt;/gml:coordinates&gt;<br>&lt;/gml:Point&gt;<br>&lt;/feature:the_geom&gt;<br>&lt;feature:name&gt;test&lt;/feature:name&gt;<br>&lt;/feature:popplace&gt;<br>&lt;/wfs:Insert&gt;<br>&lt;/wfs:Transaction&gt;<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>