title: Javascript editing WFS from GeoServer using OpenLayers
body: <p>After reading a very good <a href="http://wordpress-dbauszus.rhcloud.com/wfs-t-with-openlayers-3-5/" rel="nofollow noreferrer">tutorial on how to edit WFS with OpenLayers</a>, I've tried replicating it but with my own WFS layer from Geoserver. Need some Javascript help finding what's wrong with it.</p>
  
  <p>I managed to load the WFS and my basemap successfully and managed to get the buttons to show up. The buttons appear correctly like in the <a href="http://dbauszus-webmaps.appspot.com/ol3-wfs-t" rel="nofollow noreferrer">working example from that page</a> but, for some reason the geometry data isn't being saved. Every time a user draws something, a new id is created on the table but its associated geometry column is left empty</p>
  
  <p>The bit for posting is:</p>
  
  <pre><code>var formatWFS = new ol.format.WFS();
  var formatGML = new ol.format.GML({
  featureNS: 'http://geoserver.org/bftchamber',
  featureType: 'bft',
  srsName: 'EPSG:27700'
  });
  var transactWFS = function(p,f) {
  switch(p) {
  case 'insert':
      node = formatWFS.writeTransaction([f],null,null,formatGML);
      break;
  case 'update':
      node = formatWFS.writeTransaction(null,[f],null,formatGML);
      break;
  case 'delete':
      node = formatWFS.writeTransaction(null,null,[f],formatGML);
      break;
  }
  s = new XMLSerializer();
  str = s.serializeToString(node);
  $.ajax('http://localhost:8080/geoserver/wfs',{
      type: 'POST',
      dataType: 'xml',
      processData: false,
      contentType: 'text/xml',
      data: str
      }).done();
  }
  </code></pre>
  
  <p>Fiddle with the whole code (apologies if it looks messy, most of it comes from the working example <a href="http://dbauszus-webmaps.appspot.com/ol3-wfs-t" rel="nofollow noreferrer">2</a> )
  <a href="https://jsfiddle.net/Luffydude/ex06jr1e/6/" rel="nofollow noreferrer">https://jsfiddle.net/Luffydude/ex06jr1e/6/</a></p>
  
  <p>The app looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/SSnhy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SSnhy.jpg" alt="enter image description here"></a></p>
  
  <p>Also even though my WFS appears correctly along the river Thames when I load it in QGIS, in my app it appears somewhere else in the ocean even though I specified EPSG 27700 (though this is just a minor annoyance at the moment).</p>
  
  <p>My main problem now is how to make the edit buttons save user edits to the WFS layer?</p>