<div dir="ltr">Hi, Thanks for the sample wfs link and for the Kosmo GIS suggestion.<div><br></div><div>I found a temporary workaround for my problem.</div><div>In the tinyows.xml file I added a setting: check_schema="0". Now adding new features works like charm with OpenLayers and with QGIS.</div>
<div><br></div><div>So, it seems that my error is somehow related to "schema validation". When I looked at my insert request, I found that the xsi:schemaLocation is different from your example. In my error case it is:</div>
<div><br></div><div><ol class="" style="margin:0px;min-width:100%;list-style-type:none;color:rgb(48,57,66);font-family:Ubuntu,Arial,sans-serif;font-size:12px;padding:2px 6px!important"><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word;white-space:nowrap">
<span class="" style="font-family:'dejavu sans mono',monospace;white-space:pre-wrap;display:inline;margin-right:100px;word-break:break-all;margin-top:1px;font-size:11px!important">xsi:schemaLocation="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"</span></li>
</ol></div><div class="gmail_extra"><br>But in your working example it is:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-family:Tahoma;font-size:13px">      xsi:schemaLocation="</span><a href="http://www.opengis.net/wfs" target="_blank" style="font-family:Tahoma;font-size:13px">http://www.opengis.net/wfs</a><span style="font-family:Tahoma;font-size:13px"> </span><a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" target="_blank" style="font-family:Tahoma;font-size:13px">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a><span style="font-family:Tahoma;font-size:13px"> </span><a href="http://hip.latuviitta.org/cgi-bin/tinyows?SERVICE=WFS&REQUEST=DescribeFeatureType&version=1.0.0&TYPENAME=lv:editable_multipolygons&NAMESPACE=xmlns(lv=http://latuviitta.fi/)" target="_blank" style="font-family:Tahoma;font-size:13px">http://hip.latuviitta.org/cgi-bin/tinyows?SERVICE=WFS&amp;REQUEST=DescribeFeatureType&amp;version=1.0.0&amp;TYPENAME=lv:editable_multipolygons&amp;NAMESPACE=xmlns(lv=http://latuviitta.fi/)</a><span style="font-family:Tahoma;font-size:13px"> </span><a href="http://latuviitta.fi/" target="_blank" style="font-family:Tahoma;font-size:13px">http://latuviitta.fi/</a><span style="font-family:Tahoma;font-size:13px">"</span><br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">So, it seems that I'm missing some parts of the xsi:schemaLocation attribute such as TYPENAME and NAMESPACE.</div><div class="gmail_extra">Any ideas what the xsi:schemaLocation means? Is this somehow related to the schema_dir, ns_prefix and ns_uri settings in my tinyows.xml file? I'm really quite confused what the schema, prefix and namespace in the wfs come from.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">--Jiri</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 7:56 AM, Rahkonen Jukka  (Tike) <span dir="ltr"><<a href="mailto:jukka.rahkonen@mmmtike.fi" target="_blank">jukka.rahkonen@mmmtike.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi,<br>
<br>
You can try if you can have success with my server <a href="http://hip.latuviitta.org/cgi-bin/tinyows" target="_blank">http://hip.latuviitta.org/cgi-bin/tinyows</a><b><br>
</b>Kosmo GIS which is an excellent open source GIS client for WFS creates the following request. Compare and see if you'll find something interesting.<div class="im"><br>
<br>
<?xml version='1.0' encoding='UTF-8'?><br></div>
<wfs:Transaction version="1.0.0" service="WFS" xmlns:lv="<a href="http://latuviitta.fi/" target="_blank">http://latuviitta.fi/</a>" <br>
xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" <br>
xmlns:ogc="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>" <br>
xmlns:wfs="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>" <br>
xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>" <br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" <br>
xsi:schemaLocation="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a> <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> <a href="http://hip.latuviitta.org/cgi-bin/tinyows?SERVICE=WFS&REQUEST=DescribeFeatureType&version=1.0.0&TYPENAME=lv:editable_multipolygons&NAMESPACE=xmlns(lv=http://latuviitta.fi/)" target="_blank">http://hip.latuviitta.org/cgi-bin/tinyows?SERVICE=WFS&amp;REQUEST=DescribeFeatureType&amp;version=1.0.0&amp;TYPENAME=lv:editable_multipolygons&amp;NAMESPACE=xmlns(lv=http://latuviitta.fi/)</a>
 <a href="http://latuviitta.fi/" target="_blank">http://latuviitta.fi/</a>"><br>
<wfs:Insert handle="insert1" idgen="GenerateNew"><br>
<lv:editable_multipolygons xmlns:lv="<a href="http://latuviitta.fi/" target="_blank">http://latuviitta.fi/</a>"><br>
<lv:geom><gml:MultiPolygon xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" srsName="EPSG:3067"><br>
<gml:polygonMember><br>
<gml:Polygon xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" srsName="EPSG:3067">    <br>
<gml:outerBoundaryIs>       <br>
<gml:LinearRing>  <br>
<gml:coordinates>195203.757,<a href="tel:7279828.574" value="+17279828574" target="_blank">7279828.574</a> 225034.737,7307065.556 262647.711,7278531.575 260053.713,7238324.602 217252.742,7242215.6 195203.757,7279828.574
<br><div class="im">
</gml:coordinates><br>
</gml:LinearRing>     <br>
</gml:outerBoundaryIs>     <br>
</gml:Polygon><br>
</gml:polygonMember><br>
</gml:MultiPolygon><br></div>
</lv:geom><br>
</lv:editable_multipolygons><br>
</wfs:Insert><br>
</wfs:Transaction><span class=""><font color="#888888"><br>
<br>
-Jukka Rahkonen-</font></span><div><div class="h5"><br>
<br>
<b><br>
</b> Jiří Kadlec <font>w</font>rote:<br>
<div style="font-size:16px;font-family:'Times New Roman'">
<div style="direction:ltr"><font color="#000000" face="Tahoma"></font><br>
</div>
<div></div>
<div>
<div dir="ltr">> I have installed and set-up TinyOWS for editing features from PostGIS database on a RHEL6 Linux server.
<div>> Displaying features is working OK in QGIS and in Openlayers.<br>
</div>
<div>> Editing a feature also works correctly.</div>
<div>> However, when I try to insert a new feature I get the following error response:</div>
<div><br>
</div>
<div>
<div><?xml version='1.0' encoding='UTF-8'?></div>
<div><ows:ExceptionReport</div>
<div> xmlns='<a href="http://www.opengis.net/ows" target="_blank">http://www.opengis.net/ows</a>'</div>
<div> xmlns:ows='<a href="http://www.opengis.net/ows" target="_blank">http://www.opengis.net/ows</a>'</div>
<div> xmlns:xsi='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'</div>
<div> xsi:schemaLocation='<a href="http://www.opengis.net/ows" target="_blank">http://www.opengis.net/ows</a>
<a href="http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd" target="_blank">
http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd</a>'</div>
<div> version='1.1.0' language='en'></div>
<div> <ows:Exception exceptionCode='InvalidParameterValue' locator='request'></div>
<div>  <ows:ExceptionText>XML request isn't valid</ows:ExceptionText></div>
<div> </ows:Exception></div>
<div></ows:ExceptionReport></div>
<div><br>
</div>
<div>Here is the Request payload that gets posted to TinyOWS:</div>
<div>
<ol style="margin:0px;min-width:100%;list-style-type:none;color:rgb(48,57,66);font-family:Ubuntu,Arial,sans-serif;font-size:12px;padding:2px 6px!important">
<li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word;white-space:nowrap">
<span style="font-family:'dejavu sans mono',monospace;white-space:pre-wrap;display:inline;margin-right:100px;word-break:break-all;margin-top:1px;font-size:11px!important"><wfs:Transaction xmlns:wfs="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>"
 service="WFS" version="1.0.0" xsi:schemaLocation="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>
<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>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><wfs:Insert><feature:mk_city_centre xmlns:feature="<a href="https://geoinformatics.aalto.fi/" target="_blank">https://geoinformatics.aalto.fi/</a>"><feature:the_geom3857><gml:MultiPolygon
 xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>" 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></span>
</li></ol>
<div><font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font></div>
</div>
<div><br>
</div>
<div><br>
</div>
-- <br>
My TinyOWS error log shows:</div>
<div><br>
</div>
<div>
<ol style="margin:0px;min-width:100%;list-style-type:none;padding:2px 6px!important">
<li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
</li><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
<font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap">[Thu Jan 23 04:45:19 2014] [ERROR] Element '{<a href="http://www.w3.org/2001/XMLSchema%7Dimport" target="_blank">http://www.w3.org/2001/XMLSchema}import</a>':
 Failed to locate a schema at location '<a href="https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=WFS&request=DescribeFeatureType&version=1.0.0" target="_blank">https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=WFS&request=DescribeFeatureType&version=1.0.0</a>'.
 Skipping the import.</span></font> </li><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
<font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font></li><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
<font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap">[Thu Jan 23 04:45:19 2014] [ERROR] Element '{<a href="https://geoinformatics.aalto.fi/%7Dmk_city_centre" target="_blank">https://geoinformatics.aalto.fi/}mk_city_centre</a>':
 This element is not expected. Expected is one of ( {<a href="http://www.opengis.net/gml%7D_Feature" target="_blank">http://www.opengis.net/gml}_Feature</a>, {<a href="http://www.opengis.net/wfs%7DFeatureCollection" target="_blank">http://www.opengis.net/wfs}FeatureCollection</a>
 ).</span></font> </li><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
<font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font></li><li title="" style="padding:0px 0px 0px 14px;margin-top:1px;word-wrap:break-word">
<font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap">[Thu Jan 23 04:45:19 2014] [ERROR] XML request isn't valid</span></font></li><li></li></ol>
</div>
<div><font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font></div>
<div><font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font></div>
<div><font color="#303942" face="dejavu sans mono, monospace"><span style="font-size:11px;white-space:pre-wrap"><br>
</span></font>Here's my tinyows.xml configuration file:</div>
<div><br>
</div>
<div>
<div><tinyows online_resource="<a href="https://geoinformatics.aalto.fi/kala/tinyows.cgi" target="_blank">https://geoinformatics.aalto.fi/kala/tinyows.cgi</a>"</div>
<div>         schema_dir="/usr/local/share/tinyows/schema/"</div>
<div>         log="/tmp/tinyows.log"</div>
<div>         log_level="1"></div>
<div>  <pg host="localhost" user="postgres" password="*********" dbname="LAHTI" port="5432"/></div>
<div><br>
</div>
<div>  <metadata name="TinyOWS Server"</div>
<div>            title="Lahti Urban  WFS Server" /></div>
<div><br>
</div>
<div>  <layer retrievable="1"</div>
<div>         writable="1"</div>
<div>         ns_prefix="tows"</div>
<div>         ns_uri="<a href="https://geoinformatics.aalto.fi/" target="_blank">https://geoinformatics.aalto.fi/</a>"</div>
<div>         name="subwatersheds"</div>
<div>         title="subwatersheds" /></div>
<div><br>
</div>
<div> <layer retrievable="1"</div>
<div>         writable="1"</div>
<div>         ns_prefix="tows"</div>
<div>         ns_uri="<a href="https://geoinformatics.aalto.fi/" target="_blank">https://geoinformatics.aalto.fi/</a>"</div>
<div>         name="mk_city_centre"</div>
<div>         title="Lahti City Centre"</div>
<div>         exclude_items="the_geom3880" /></div>
</div>
<div>
<div></tinyows></div>
</div>
<div><br>
</div>
<div>And finally, here is my OpenLayers editing client javascript code snippet:</div>
<div>
<div>  </div>
<div>  var saveStrategy = new OpenLayers.Strategy.Save();</div>
<div>  saveStrategy.events.register("success", '', showSuccessMsg);</div>
<div>  saveStrategy.events.register("fail", '', showFailureMsg);</div>
<div>  wfs = new OpenLayers.Layer.Vector("Editable Features", {</div>
<div>      strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],</div>
<div>      projection: new OpenLayers.Projection("EPSG:3857"),</div>
<div>      protocol: new OpenLayers.Protocol.WFS({</div>
<div>          version: "1.0.0",</div>
<div>          srsName: "EPSG:3857",</div>
<div>          url: "<a href="https://geoinformatics.aalto.fi/kala/tinyows.cgi" target="_blank">https://geoinformatics.aalto.fi/kala/tinyows.cgi</a>",</div>
<div>          featureNS :  "<a href="https://geoinformatics.aalto.fi/" target="_blank">https://geoinformatics.aalto.fi/</a>",</div>
<div>          featureType: "mk_city_centre",</div>
<div>          geometryName: "the_geom3857"</div>
<div>          //schema: "<a href="https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=tows:mk_city_centre" target="_blank">https://geoinformatics.aalto.fi/kala/tinyows.cgi?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=tows:mk_city_centre</a>"</div>

<div>      })</div>
<div>  });</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>I've never used TinyOWS before. Any Ideas what I'm doing wrong? Especially the error message </div>
<div><span style="color:rgb(48,57,66);font-family:'dejavu sans mono',monospace;font-size:11px;white-space:pre-wrap">Element '{<a href="https://geoinformatics.aalto.fi/%7Dmk_city_centre" target="_blank">https://geoinformatics.aalto.fi/}mk_city_centre</a>':
 This element is not expected. Expected is one of ( {<a href="http://www.opengis.net/gml%7D_Feature" target="_blank">http://www.opengis.net/gml}_Feature</a>, {<a href="http://www.opengis.net/wfs%7DFeatureCollection" target="_blank">http://www.opengis.net/wfs}FeatureCollection</a>
 ).</span></div>
<div><br>
is confusing.</div>
<div><br>
</div>
<div>Thanks in advance for any hints or suggestions how to solve the problem.<br>
<br>
</div>
<div>Jiri Kadlec</div>
</div>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jiří Kadlec<br>Research Assistant<br>Aalto university<br>Lahti, Finland<br>
</div></div>