[TinyOWS-users] error inserting feature
luca marletta
lucamarle at gmail.com
Thu Nov 25 11:52:23 EST 2010
Hi List,
I'm orking with Openlayers 2.9 and tinywows 0.9, postgis 1.5.2 and
all for fine in my application for update data on postgis but I get an
error inserting
I've already test with my system the transactional example and I can
easily insert geometry into postgis.
But my application manage also data and I always get error related to scheme.
here details
update feature (successfully)
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://127.0.0.1
http://127.0.0.1/cgi-bin/tinyows?service=WFS&request=DescribeFeatureType&version=1.1.0&TypeName=sitManomissioni"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Update typeName="feature:sitManomissioni" xmlns:feature="http://127.0.0.1">
<wfs:Property>
<wfs:Name>the_geom</wfs:Name>
<wfs:Value>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml"
srsName="EPSG:3003"><gml:exterior><gml:LinearRing><gml:posList>1491940
5057397 1491954 5057398 1491988.933324189 5057168.6500034295 1491990
5056952 1491976 5056950 1491940
5057397</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>
</wfs:Value>
</wfs:Property><wfs:Property>
<wfs:Name>rete</wfs:Name>
<wfs:Value>1</wfs:Value>
</wfs:Property><wfs:Property><wfs:Name>oggetto</wfs:Name>
<wfs:Value>ewew</wfs:Value></wfs:Property><wfs:Property>
<wfs:Name>descrizione</wfs:Name>
<wfs:Value>ewew</wfs:Value>
</wfs:Property>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:FeatureId fid="sitManomissioni.3"/></ogc:Filter>
</wfs:Update>
</wfs:Transaction>
This on contrary is the firebug post for inserting
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://127.0.0.1
http://127.0.0.1/cgi-bin/tinyows?service=WFS&request=DescribeFeatureType&version=1.1.0&TypeName=sitManomissioni"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Insert>
<feature:sitManomissioni xmlns:feature="http://127.0.0.1">
<feature:the_geom>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3003">
<gml:exterior>
<gml:LinearRing>
<gml:posList>1491853.5332174 5057142.5285297 1491930.4387314
5057145.3507504 1491910.6831865 5057057.1563535 1491863.4109898
5057069.8563467 1491837.3054484 5057078.3230088 1491853.5332174
5057142.5285297</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</feature:the_geom>
<feature:rete>2</feature:rete>
<feature:oggetto>dddd</feature:oggetto>
<feature:descrizione>ssss</feature:descrizione>
</feature:sitManomissioni>
</wfs:Insert>
</wfs:Transaction>
error in tinyows.log is
[Thu Nov 25 17:15:44 2010] [ERROR] Element
'{http://www.w3.org/2001/XMLSchema}import': Skipping import of schema
located at 'http://schemas.opengis.net/gml/3.1.1/base/gml.xsd' for the
namespace 'http://www.opengis.net/gml', since this namespace was
already imported with the schema located at
'/usr/local/tinyows/schema/gml/3.1.1/base/gml.xsd'.
[Thu Nov 25 17:15:44 2010] [ERROR] Element '{http://127.0.0.1}rete':
This element is not expected.
[Thu Nov 25 17:15:44 2010] [ERROR] xml isn't valid
[Thu Nov 25 17:15:44 2010] [EVENT] == TINYOWS SHUTDOWN ==
others details
vector layer
vMan= new OpenLayers.Layer.Vector("Edit manomissioni", {
styleMap: oStyleMap,
strategies: [new OpenLayers.Strategy.BBOX(), oSaveStrategy],
projection: new OpenLayers.Projection("EPSG:3003"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://127.0.0.1/cgi-bin/tinyows",
featureType: "sitManomissioni", // la tabella postgis lo srid deve
corrispondere e deve avere la chiave primaria
featureNS: "http://127.0.0.1",
srsName: "EPSG:3003", // non lasciare spazi dopo i ":"
geometryName: "the_geom",
schema: "http://127.0.0.1/cgi-bin/tinyows?service=WFS&request=DescribeFeatureType&version=1.1.0&TypeName=sitManomissioni"
})
});
tinyows config
<tinyows online_resource="http://127.0.0.1/cgi-bin/tinyows"
schema_dir="/usr/local/tinyows/schema/" check_schema= "1"
log="/tmp/tinyows.log">
<pg host="127.0.0.1" user="user" password="pass" dbname="gorla_sit"
port="5432"/>
<metadata
name="Viario"
title="TinyOWS Service"
keywords="tinyows,ows,wfs,ogc"
online_resource="http://www.beopen.it/"
fees="free"
access_constraint="nope" >
<abstract>
....
</abstract>
<contact
name="BeOpen"
....
</metadata>
<layer queryable = "1"
retrievable = "1"
writable = "1"
prefix = "sitManomissioni"
server = "http://127.0.0.1"
name = "sitManomissioni"
srid = "3003"
title = "manomissioni" />
</tinyows>
It seems that the key is in the log
[Thu Nov 25 17:15:44 2010] [ERROR] Element '{http://127.0.0.1}rete':
This element is not expected.
but what's the problem? in scheme? what version I must use?
thanks a lot for helping
PS here the reply in browser for call
http://127.0.0.1/cgi-bin/tinyows?service=WFS&request=DescribeFeatureType&version=1.1.0&TypeName=sitManomissioni
<xs:schema targetNamespace="http://127.0.0.1"
elementFormDefault="qualified" version="1.1">
<xs:import namespace="http://www.opengis.net/gml"
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
<xs:element name="sitManomissioni"
type="sitManomissioni:sitManomissioniType"
substitutionGroup="gml:_Feature"/>
−
<xs:complexType name="sitManomissioniType">
−
<xs:complexContent>
−
<xs:extension base="gml:AbstractFeatureType">
−
<xs:sequence>
<xs:element name="id_man" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="nid" type="int" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="id_via" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="rete" type="string" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="id_gest" type="short" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="d_rich" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="d_aut" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="d_iniz" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="d_fine" type="int" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="oggetto" type="string" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="descrizione" type="string" nillable="true"
minOccurs="0" maxOccurs="1"/>
<xs:element name="stato" type="string" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="the_geom" type="gml:GeometryPropertyType"
nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
luca
luca marletta
www.beopen.it
More information about the TinyOWS-users
mailing list