[Geoserver-users] Problem with insert transactio

Sebastian ha scritto:

Hello,

I try to insert some data into a (postgis) layer. But all my attempts
failed.

First of all the Feature I try to insert a new "street".

Describe Feature XML:
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://localhost/sa&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;

schemaLocation="http://localhost:8080/geoserver/wfs/schemas/gml/3.1.1/base/g
ml.xsd"/>

<xsd:complexType name="2430_road_lineType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="gdo_gid" nillable="true"
type="xsd:long"/>
<xsd:element maxOccurs="1" minOccurs="0" name="tag" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="feat_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="geom_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="descriptio"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true"
type="gml:MultiLineStringPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="2430_road_line" substitutionGroup="gml:_Feature"
type="sa:2430_road_lineType"/>
</xsd:schema>

The Transaction XML:
<wfs:Transaction
version="1.0.0"
service="WFS"
xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns="http://localhost/sa&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
<wfs:Insert>
<wfs:2430_road_line>
<wfs:the_geom>
<gml:MultiLineString
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
<gml:lineStringMember>
<gml:LineString>
<gml:coordinates decimal="." cs="," ts=" ">
30.37543,-24.34111 30.41411,-24.37335
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</wfs:the_geom>
</wfs:2430_road_line>
</wfs:Insert>
</wfs:Transaction>

And last but not least, the Exception:
<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
<ServiceException>> org.xml.sax.SAXParseException: Element or attribute
do not match QName production: QName::=(NCName':')?NCName.
Element or attribute do not match QName production:
QName::=(NCName':')?NCName.
</ServiceException>
</ServiceExceptionReport>

Maybe someone can help me or give me a hint, I really tried everything I
can image.

Mumble, I'm not sure if this is the problem GeoServer is reporting
in the error message, but for sure you got the 2430_road_line and
the_geom prefixes wrong, they are no part of the gml namespace, they
are part of the "http://localhost/sa&quot; one, so, you should not prefix
them at all, or declare a prefix such as xmlns:sa="http://localhost/sa&quot;
and then use sa:2430_road_line and sa:the_geom.

Hope this helps
Cheers
Andrea

Hi,

that's not the problem, I used it with the "correct" prefix before but I
read something to do it with the wfs prefix. Nevertheless, I switch back to
the SA prefix, but it still doesn't work. So, that's not the problem I guess
:-/

Regards,
Sebastian

Hi Sebastian,

The problem here is that your feature type / table name starts with a number. In WFS this is not a valid identifier for a feature type. If you change it or point a view at it, and register the view as a feature type you should see this work fine.

-Justin

Sebastian wrote:

Sebastian ha scritto:

Hello,

I try to insert some data into a (postgis) layer. But all my attempts
failed.

First of all the Feature I try to insert a new "street".

Describe Feature XML:
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://localhost/sa&quot;&gt;
<xsd:import namespace="http://www.opengis.net/gml&quot;

schemaLocation="http://localhost:8080/geoserver/wfs/schemas/gml/3.1.1/base/g
ml.xsd"/>

<xsd:complexType name="2430_road_lineType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="gdo_gid" nillable="true"
type="xsd:long"/>
<xsd:element maxOccurs="1" minOccurs="0" name="tag" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="feat_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="geom_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="descriptio"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true"
type="gml:MultiLineStringPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="2430_road_line" substitutionGroup="gml:_Feature"
type="sa:2430_road_lineType"/>
</xsd:schema>

The Transaction XML:
<wfs:Transaction
version="1.0.0"
service="WFS"
xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns="http://localhost/sa&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
<wfs:Insert>
<wfs:2430_road_line>
<wfs:the_geom>
<gml:MultiLineString
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
<gml:lineStringMember>
<gml:LineString>
<gml:coordinates decimal="." cs="," ts=" ">
30.37543,-24.34111 30.41411,-24.37335
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</wfs:the_geom>
</wfs:2430_road_line>
</wfs:Insert>
</wfs:Transaction>

And last but not least, the Exception:
<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
<ServiceException>> org.xml.sax.SAXParseException: Element or attribute
do not match QName production: QName::=(NCName':')?NCName.
Element or attribute do not match QName production:
QName::=(NCName':')?NCName.
</ServiceException>
</ServiceExceptionReport>

Maybe someone can help me or give me a hint, I really tried everything I
can image.

Mumble, I'm not sure if this is the problem GeoServer is reporting
in the error message, but for sure you got the 2430_road_line and
the_geom prefixes wrong, they are no part of the gml namespace, they
are part of the "http://localhost/sa&quot; one, so, you should not prefix
them at all, or declare a prefix such as xmlns:sa="http://localhost/sa&quot;
and then use sa:2430_road_line and sa:the_geom.

Hope this helps
Cheers
Andrea

Hi,

that's not the problem, I used it with the "correct" prefix before but I
read something to do it with the wfs prefix. Nevertheless, I switch back to
the SA prefix, but it still doesn't work. So, that's not the problem I guess
:-/

Regards,
Sebastian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
Software Engineer, OpenGeo
http://opengeo.org