I'm looking for some info on using the restful interface to add a shapefile
datastore to geoserver 2.0.2 without copying the shapefiles to geoserver in
the .zip file. Is there anybody who could point me to the code that would
implement the functions I need.
John
On Mon, Sep 27, 2010 at 10:22 AM, John Preston <[email protected]> wrote:
> Hi Shreerang, Thanks for trying to help. I tried that but the text in the
> body then has to have an xml format <...>...</....> and I don't know this..
> So if I put just the path in the body it complains about not being xml. If I
> make up some format such as <file>/path/to/file</file> then it gives an
> internal server error. This may actually be the way but I need to know what
> the xml format should be.
>
> Can anyone say.
> John
>
>
> On Sat, Sep 25, 2010 at 12:09 AM, Shreerang Patwardhan <
> [email protected]> wrote:
>
>> Hello John,
>> I am not an expert but I think you should try Content type:
>> application/xml in your command instead of "text/plain"! Just give it a try
>> and let me know if it works!
>>
>> Regards,
>> Shreerang Patwardhan.
>>
>> On Fri, Sep 24, 2010 at 10:31 PM, John Preston <[email protected]>wrote:
>>
>>> I am trying to add a shapefile datastore to a geoserver 2.0.2 instance. I
>>> have been able to get it to work using the following command
>>>
>>> curl -u admin:geoserver -v -XPUT -H 'Context-type: application/zip'
>>> --data-binary '/home/path/to/test.zip'
>>> http://localhost:8080/geoserver/rest/workspaces/sf/datastore/sf/file.shp
>>>
>>> However I already have the shape files stored in a particular directory
>>> and I simply want to reference them. When I try the following command which
>>> I was told by a guy in the open-geo booth at FOSS4G-2010 would it gives me
>>> an error.
>>>
>>> curl -u admin:geoserver -v -XPUT -H 'Content-type: text/plain' -d
>>> '/home/path/to/test.shp'
>>> http://localhost:8080/geoserver/rest/workspaces/sf/datastores/sf/external.shp
>>> * About to connect() to localhost port 8080 (#0)
>>> * Trying ::1... connected
>>> * Connected to localhost (::1) port 8080 (#0)
>>> * Server auth using Basic with user 'admin'
>>> > PUT /geoserver/rest/workspaces/sf/datastores/sf/external.shp HTTP/1.1
>>> > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
>>> > User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7
>>> OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
>>> > Host: localhost:8080
>>> > Accept: */*
>>> > Content-type: text/plain
>>> > Content-Length: 20
>>> >
>>> < HTTP/1.1 400 Bad Request
>>> < Transfer-Encoding: chunked
>>> < Server: Jetty(6.1.8)
>>> <
>>> * Connection #0 to host localhost left intact
>>> * Closing connection #0
>>> Could not determine format. Try setting the Content-type header.
>>>
>>> It is supposedly telling me that the text/plain content type is unknown
>>> but I can't get any other combination other then application/zip to work.
>>>
>>> Can anyone say what I'm doing wrong or is what I'm trying to do not
>>> posible and I need to program my own restful interface to do it.
>>>
>>> John
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Start uncovering the many advantages of virtual appliances
>>> and start using them to simplify application deployment and
>>> accelerate your shift to cloud computing.
>>> http://p.sf.net/sfu/novell-sfdev2dev
>>> _______________________________________________
>>> Geoserver-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>
>>>
>>
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users