The following is the code I use, which does not work
curl -v -u admin:geoserver -XPUT -H 'Content-type: text/xml' -d
'<featureType>
<name>h12v10_locations_20ztesting</name>
<nativeName>h12v10_locations_20ztesting</nativeName>
<srs>EPSG:4326</srs>
<metadata><entry>
<virtualTable><name>h12v10_locations_20ztesting</name>
<sql>select gid, poly_label, data_score, data_time, year, the_geom
from h12v10_locations_2002
order by gid asc</sql>
<keyColumn>feature_id</keyColumn>
<geometry><name>the_geom</name><type>POINT</type><srid>4326</srid></geometry>
</virtualTable></entry></metadata></featureType>'
http://localhost:8080/geoserver/rest/layers/cite:h12v10_locations_20ztesting.xml
I want to use sql view than creating layer is that when I update data is PostGIS, the order of data entries retrieved by client will change. For example, when I update id=1, the first entries retrieved will become id=2 from id=1
java.lang.RuntimeException: org.xml.sax.SAXParseException; Premature end of file. org.xml.sax.SAXParseException; Premature end of file. Premature end of file.
– Sean