Hi,
I'm not able to make my WFS insert work on trunk against the
versioned data store, whilst the same request against tasmania roads works fine.
So, I'm posting some hints hoping someone is able to get something out of them.
This is the tasmania request, that works
<wfs:Transaction service="WFS" version="1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:topp="http://www.openplans.org/topp"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:tasmania_roads">
<wfs:Insert>
<topp:road>
<topp:id>600</topp:id>
<topp:geom>
<gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts=" ">5 5 10 10 15 5</gml:coordinates>
</gml:LineString>
</topp:geom>
<topp:name>curva</topp:name>
</topp:road>
</wfs:Insert>
</wfs:Transaction>
Oh hum, first thing suprising me is that the schema location for topp:roads in this request is wrong. There is nothing answering at
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:road
The request is simply wrong, unless we had a specific shortcut for DescribeFeatureType.
The proper request is:
http://localhost:8080/geoserver/wfs?request=DescribeFeatureType&typename=topp:tasmania_roads&version=1.0.0
but pasting there the proper request simply breaks the xml parser, that complains the xml is malformed:
org.xmlpull.v1.XmlPullParserException: entity reference name can not contain character =' (position: START_DOCUMENT seen ...localhost:8080/geoserver/wfs?request=DescribeFeatureType&typename=... @13:210)
Anyways, if I try to insert with my feature type, it breaks at xml feature parsing level.
Here is my the describe feature type output for "topp:road":
<?xml version="1.0" encoding="UTF-8"?><xs:schema targetNamespace="http://www.openplans.org/topp" xmlns:topp="http://www.openplans.org/topp" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"><xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/2.1.2/feature.xsd"/><xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="road_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="id" minOccurs="0" nillable="true" type="xs:int"/>
<xs:element name="geom" minOccurs="0" nillable="true" type="gml:LineStringPropertyType"/>
<xs:element name="name" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name='road' type='topp:road_Type' substitutionGroup='gml:_Feature'/></xs:schema>
And here is my request:
<wfs:Transaction service="WFS" version="1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:topp="http://www.openplans.org/topp"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:road">
<wfs:Insert>
<topp:road>
<topp:id>600</topp:id>
<topp:geom>
<gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts=" ">5 5 10 10 15 5</gml:coordinates>
</gml:LineString>
</topp:geom>
<topp:name>curva</topp:name>
</topp:road>
</wfs:Insert>
</wfs:Transaction>
much alike tasmania_roads, seems to respect the schema, but all I get is:
org.xml.sax.SAXException: Handler for topp:name could not be found.
at org.geotools.xml.impl.ParserHandler.startElement(ParserHandler.java:380)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.geotools.xml.Parser.parse(Parser.java:184)
at org.geotools.xml.Parser.parse(Parser.java:163)
at org.geoserver.wfs.xml.v1_0_0.WfsXmlReader.read(WfsXmlReader.java:28)
at org.geoserver.ows.Dispatcher.parseRequestXML(Dispatcher.java:955)
at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:365)
Oh hum... why is that??? The schema specifies element names are qualified, so topp:name should be ok.
Having that http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:road
link working would be nice too, since it would allow the request to be
put into a xml editor with validation and auto-completion too.
Cheers
Andrea