[mapserver-users] TinyOWS insert feature not working

Jiří Kadlec jirikadlec2 at gmail.com
Wed Jan 22 19:03:04 PST 2014


I have installed and set-up TinyOWS for editing features from PostGIS
database on a RHEL6 Linux server.
Displaying features is working OK in QGIS and in Openlayers.
Editing a feature also works correctly.
However, when I try to insert a new feature I get the following error
response:

<?xml version='1.0' encoding='UTF-8'?>
<ows:ExceptionReport
 xmlns='http://www.opengis.net/ows'
 xmlns:ows='http://www.opengis.net/ows'
 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
 xsi:schemaLocation='http://www.opengis.net/ows
http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'
 version='1.1.0' language='en'>
 <ows:Exception exceptionCode='InvalidParameterValue' locator='request'>
  <ows:ExceptionText>XML request isn't valid</ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

Here is the Request payload that gets posted to TinyOWS:

   1. <wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
   version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs
   http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="
   http://www.w3.org/2001/XMLSchema-instance"><wfs:Insert><feature:mk_city_centre
   xmlns:feature="https://geoinformatics.aalto.fi/"><feature:the_geom3857><gml:MultiPolygon
   xmlns:gml="http://www.opengis.net/gml"
   srsName="EPSG:3857"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
   decimal="." cs="," ts=" ">2852436.2002366,8629373.6312116
   2851633.6114397,8628494.6053864 2850678.1485863,8629067.8830985
   2850563.4930439,8630176.2200085
   2852436.2002366,8629373.6312116</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></feature:the_geom3857></feature:mk_city_centre></wfs:Insert></wfs:Transaction>




-- 
My TinyOWS error log shows:


   1.
   2. [Thu Jan 23 04:45:19 2014] [ERROR] Element '{
   http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at
   location '
   https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=WFS&request=DescribeFeatureType&version=1.0.0'.
   Skipping the import.
   3.
   4. [Thu Jan 23 04:45:19 2014] [ERROR] Element '{
   https://geoinformatics.aalto.fi/}mk_city_centre': This element is not
   expected. Expected is one of ( {http://www.opengis.net/gml}_Feature, {
   http://www.opengis.net/wfs}FeatureCollection ).
   5.
   6. [Thu Jan 23 04:45:19 2014] [ERROR] XML request isn't valid
   7.




Here's my tinyows.xml configuration file:

<tinyows online_resource="https://geoinformatics.aalto.fi/kala/tinyows.cgi"
         schema_dir="/usr/local/share/tinyows/schema/"
         log="/tmp/tinyows.log"
         log_level="1">
  <pg host="localhost" user="postgres" password="*********" dbname="LAHTI"
port="5432"/>

  <metadata name="TinyOWS Server"
            title="Lahti Urban  WFS Server" />

  <layer retrievable="1"
         writable="1"
         ns_prefix="tows"
         ns_uri="https://geoinformatics.aalto.fi/"
         name="subwatersheds"
         title="subwatersheds" />

 <layer retrievable="1"
         writable="1"
         ns_prefix="tows"
         ns_uri="https://geoinformatics.aalto.fi/"
         name="mk_city_centre"
         title="Lahti City Centre"
         exclude_items="the_geom3880" />
</tinyows>

And finally, here is my OpenLayers editing client javascript code snippet:

  var saveStrategy = new OpenLayers.Strategy.Save();
  saveStrategy.events.register("success", '', showSuccessMsg);
  saveStrategy.events.register("fail", '', showFailureMsg);
  wfs = new OpenLayers.Layer.Vector("Editable Features", {
      strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
      projection: new OpenLayers.Projection("EPSG:3857"),
      protocol: new OpenLayers.Protocol.WFS({
          version: "1.0.0",
          srsName: "EPSG:3857",
          url: "https://geoinformatics.aalto.fi/kala/tinyows.cgi",
          featureNS :  "https://geoinformatics.aalto.fi/",
          featureType: "mk_city_centre",
          geometryName: "the_geom3857"
          //schema: "
https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=tows:mk_city_centre
"
      })
  });


I've never used TinyOWS before. Any Ideas what I'm doing wrong? Especially
the error message
Element '{https://geoinformatics.aalto.fi/}mk_city_centre': This element is
not expected. Expected is one of ( {http://www.opengis.net/gml}_Feature, {
http://www.opengis.net/wfs}FeatureCollection ).

is confusing.

Thanks in advance for any hints or suggestions how to solve the problem.

Jiri Kadlec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140123/3ad79f55/attachment.html>


More information about the mapserver-users mailing list