Geoserver REST Question

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Geoserver REST Question

dnbphysicist
Okay so I have cURL installed locally and I'm trying to run some tests
against an instance of Geoserver running on another server. I'm trying
to create a datastore remotely using the below command (copied from
http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)

My command: curl -u admin:password -XPUT -H "Content-type:
application/zip" --data-binary @states.zip
http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp

If fails with: curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
same error. Anyone with experience using this gotten it to work?

Thanks in advance!

--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

lmorandini
On 13/08/10 21:49, Robert Hicks wrote:
>   curl -u admin:password -XPUT -H "Content-type:
> application/zip" --data-binary @states.zip
> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp

The syntax is correct: are you sure you're writing everything on the same line (or
put correct escape sequence sat the end of each line) ?

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
Thanks for the response...yes, it is all in one line. My mail client
just put it on separate lines for some reason. So I don't need a url
in their somewhere?

On Sat, Aug 14, 2010 at 1:28 AM, Luca Morandini <[hidden email]> wrote:

> On 13/08/10 21:49, Robert Hicks wrote:
>>   curl -u admin:password -XPUT -H "Content-type:
>> application/zip" --data-binary @states.zip
>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>
> The syntax is correct: are you sure you're writing everything on the same line (or
> put correct escape sequence sat the end of each line) ?
>
> Regards,
>
> --------------------
>    Luca Morandini
> www.lucamorandini.it
> --------------------
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

lmorandini
On 14/08/10 15:41, Robert Hicks wrote:
> Thanks for the response...yes, it is all in one line. My mail client
> just put it on separate lines for some reason. So I don't need a url
> in their somewhere?

No, no, you definitively need one: I was just ruling out the silly syntax error.

Well, I tried your command on my machine and it worked (to the extent that it did
not find the server, which means that the URL was read and parsed correctly)...
therefore I still think this should be something preventing cURL from reading the
line in full (URL and all): you are on a *NIX box, right ?

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

aaime
In reply to this post by dnbphysicist
Robert Hicks ha scritto:
> Okay so I have cURL installed locally and I'm trying to run some tests
> against an instance of Geoserver running on another server. I'm trying
> to create a datastore remotely using the below command (copied from
> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>
> My command: curl -u admin:password -XPUT -H "Content-type:
> application/zip" --data-binary @states.zip
> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp

Hmmm... using the command line I often have to put the url between
double quotes:

curl -u admin:password -XPUT -H "Content-type: application/zip"
--data-binary @states.zip
"http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"

Not sure if this is needed by curl as well, but may be worth a try.

Cheers
Andrea


> If fails with: curl: no URL specified!
> curl: try 'curl --help' or 'curl --manual' for more information
>
> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
> same error. Anyone with experience using this gotten it to work?
>
> Thanks in advance!
>


--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
Thanks for the responses everyone! I am on Windows using DOS, sorry
should have said that from the beginning. I just tried it using Cygwin
and now it says 'No such datastore: gv,roads'. So I'm guessing that is
further than I was before!

Basically the end goal is to be able to automate the creation of many
feature types and this seems like the best way. The tool I'm planning
on writing is going to be in Java so that it can run anywhere but if
cURL is not platform independent that may be a problem.

On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:

> Robert Hicks ha scritto:
>>
>> Okay so I have cURL installed locally and I'm trying to run some tests
>> against an instance of Geoserver running on another server. I'm trying
>> to create a datastore remotely using the below command (copied from
>>
>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>
>> My command: curl -u admin:password -XPUT -H "Content-type:
>> application/zip" --data-binary @states.zip
>>
>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>
> Hmmm... using the command line I often have to put the url between double
> quotes:
>
> curl -u admin:password -XPUT -H "Content-type: application/zip"
> --data-binary @states.zip
> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>
> Not sure if this is needed by curl as well, but may be worth a try.
>
> Cheers
> Andrea
>
>
>> If fails with: curl: no URL specified!
>> curl: try 'curl --help' or 'curl --manual' for more information
>>
>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>> same error. Anyone with experience using this gotten it to work?
>>
>> Thanks in advance!
>>
>
>
> --
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

christian.mueller-2
I configure geoserver with a java utility, no curl needed at all, Java  
has all you need :-)

If you have problems coding with Java, please ask, I have simple to  
look up in my code.


Quoting Robert Hicks <[hidden email]>:

> Thanks for the responses everyone! I am on Windows using DOS, sorry
> should have said that from the beginning. I just tried it using Cygwin
> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
> further than I was before!
>
> Basically the end goal is to be able to automate the creation of many
> feature types and this seems like the best way. The tool I'm planning
> on writing is going to be in Java so that it can run anywhere but if
> cURL is not platform independent that may be a problem.
>
> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>> Robert Hicks ha scritto:
>>>
>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>> against an instance of Geoserver running on another server. I'm trying
>>> to create a datastore remotely using the below command (copied from
>>>
>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>
>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>> application/zip" --data-binary @states.zip
>>>
>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>
>> Hmmm... using the command line I often have to put the url between double
>> quotes:
>>
>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>> --data-binary @states.zip
>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>
>> Not sure if this is needed by curl as well, but may be worth a try.
>>
>> Cheers
>> Andrea
>>
>>
>>> If fails with: curl: no URL specified!
>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>
>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>> same error. Anyone with experience using this gotten it to work?
>>>
>>> Thanks in advance!
>>>
>>
>>
>> --
>> Andrea Aime
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>>
>
>
>
> --
> web http://www.hyxspace.com
> aim hyx1138
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
In reply to this post by dnbphysicist
Ok, so a bit of a follow up. I still cannot successfully create a
datastore / layer using the REST interface. Now I'm usuing Cygwin.

This command fails complaining 'No datastore gv, roads' Isn't this
suppose to create the datastore?

$ curl -u admin:ne1410s! -XPUT -H "Content-type: application/zip"
--data-binary @states.zip
"http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/states.shp"

Ok, fine, I switch the command to upload the shapefile to an existing datastore:

$ curl -u admin:ne1410s! -XPUT -H "Content-type: application/zip"
--data-binary @states.zip
"http://10.10.0.20:8001/geoserver/rest/workspaces/gv/localpostgis/states.shp"

Failure: Could not determine format. Try setting the Content-type header.

The zip file is just a .shp, .dbf, .prj, .shx, .qix, and a .fix file
all with the same name and it looks to me like I did specify the
Content type.

On Mon, Aug 16, 2010 at 9:05 AM, Robert Hicks <[hidden email]> wrote:

> Thanks for the responses everyone! I am on Windows using DOS, sorry
> should have said that from the beginning. I just tried it using Cygwin
> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
> further than I was before!
>
> Basically the end goal is to be able to automate the creation of many
> feature types and this seems like the best way. The tool I'm planning
> on writing is going to be in Java so that it can run anywhere but if
> cURL is not platform independent that may be a problem.
>
> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>> Robert Hicks ha scritto:
>>>
>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>> against an instance of Geoserver running on another server. I'm trying
>>> to create a datastore remotely using the below command (copied from
>>>
>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>
>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>> application/zip" --data-binary @states.zip
>>>
>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>
>> Hmmm... using the command line I often have to put the url between double
>> quotes:
>>
>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>> --data-binary @states.zip
>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>
>> Not sure if this is needed by curl as well, but may be worth a try.
>>
>> Cheers
>> Andrea
>>
>>
>>> If fails with: curl: no URL specified!
>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>
>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>> same error. Anyone with experience using this gotten it to work?
>>>
>>> Thanks in advance!
>>>
>>
>>
>> --
>> Andrea Aime
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>>
>
>
>
> --
> web http://www.hyxspace.com
> aim hyx1138
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

lmorandini
On 17/08/10 19:34, Robert Hicks wrote:
> Ok, so a bit of a follow up. I still cannot successfully create a
> datastore / layer using the REST interface. Now I'm usuing Cygwin.
>
> This command fails complaining 'No datastore gv, roads' Isn't this
> suppose to create the datastore?
>
> $ curl -u admin:ne1410s! -XPUT -H "Content-type: application/zip"
> --data-binary @states.zip
> "http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/states.shp"

try:

curl -u admin:ne1410s! -XPUT -H 'Content-type: application/zip' \
  --data-binary @states.zip \
http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp


> Ok, fine, I switch the command to upload the shapefile to an existing datastore:
>
> $ curl -u admin:ne1410s! -XPUT -H "Content-type: application/zip"
> --data-binary @states.zip
> "http://10.10.0.20:8001/geoserver/rest/workspaces/gv/localpostgis/states.shp"

Are you trying to add a Shapefile to a PostGIS datastore ? This ain't going to work.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
In reply to this post by christian.mueller-2
Luca, thanks for the response. Actually my mail client put those in
separate lines, I ran everything in on one line. As far as the second
failed call goes, that is kind of what I figured, but just wanted to
try using an existing datastore.

Christian, did you write a java application to interface with
Geoserver using sockets or is this an extension of the application
that has access to the underlying JVM? Like I mentioned in the very
first email, I have an application that does the former well with
1.7.x versions of Geoserver but from poking around with a packet
sniffer with 2.0.x it seems almost impossible. Which version are you
using? I'd love to hear how you do it.

On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:

> I configure geoserver with a java utility, no curl needed at all, Java has
> all you need :-)
>
> If you have problems coding with Java, please ask, I have simple to look up
> in my code.
>
>
> Quoting Robert Hicks <[hidden email]>:
>
>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>> should have said that from the beginning. I just tried it using Cygwin
>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>> further than I was before!
>>
>> Basically the end goal is to be able to automate the creation of many
>> feature types and this seems like the best way. The tool I'm planning
>> on writing is going to be in Java so that it can run anywhere but if
>> cURL is not platform independent that may be a problem.
>>
>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>>>
>>> Robert Hicks ha scritto:
>>>>
>>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>>> against an instance of Geoserver running on another server. I'm trying
>>>> to create a datastore remotely using the below command (copied from
>>>>
>>>>
>>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>>
>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>>> application/zip" --data-binary @states.zip
>>>>
>>>>
>>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>>
>>> Hmmm... using the command line I often have to put the url between double
>>> quotes:
>>>
>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>>> --data-binary @states.zip
>>>
>>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>>
>>> Not sure if this is needed by curl as well, but may be worth a try.
>>>
>>> Cheers
>>> Andrea
>>>
>>>
>>>> If fails with: curl: no URL specified!
>>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>>
>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>>> same error. Anyone with experience using this gotten it to work?
>>>>
>>>> Thanks in advance!
>>>>
>>>
>>>
>>> --
>>> Andrea Aime
>>> OpenGeo - http://opengeo.org
>>> Expert service straight from the developers.
>>>
>>
>>
>>
>> --
>> web http://www.hyxspace.com
>> aim hyx1138
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by
>>
>> Make an app they can't live without
>> Enter the BlackBerry Developer Challenge
>> http://p.sf.net/sfu/RIM-dev2dev
>> _______________________________________________
>> Geoserver-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

lmorandini
On 18/08/10 18:18, Robert Hicks wrote:
> Luca, thanks for the response. Actually my mail client put those in
> separate lines, I ran everything in on one line. As far as the second
> failed call goes, that is kind of what I figured, but just wanted to
> try using an existing datastore.

OK, but did you try to run, *exactly*, the line I've posted ?

You see, there are two differences worth noting:

1) 'Content-type: application/zip' (single quotes)
2) http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp 
(file.shp, not states.shp)

If you ran it, what was the result ?

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

christian.mueller-2
In reply to this post by dnbphysicist
My Java application runs in its own VM and uses the Java URL class. I  
am testing against 2.0.x at the moment, works fine. I will switch to  
geoserver-trunk because of the new Virtual Table feature, doing it the  
same way.

What the hell are you doing with a packet sniffer ?. I simply looked  
at the REST examples, did the same within a java test app and started  
developing.

Cheers
Christian


Quoting Robert Hicks <[hidden email]>:

> Luca, thanks for the response. Actually my mail client put those in
> separate lines, I ran everything in on one line. As far as the second
> failed call goes, that is kind of what I figured, but just wanted to
> try using an existing datastore.
>
> Christian, did you write a java application to interface with
> Geoserver using sockets or is this an extension of the application
> that has access to the underlying JVM? Like I mentioned in the very
> first email, I have an application that does the former well with
> 1.7.x versions of Geoserver but from poking around with a packet
> sniffer with 2.0.x it seems almost impossible. Which version are you
> using? I'd love to hear how you do it.
>
> On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:
>> I configure geoserver with a java utility, no curl needed at all, Java has
>> all you need :-)
>>
>> If you have problems coding with Java, please ask, I have simple to look up
>> in my code.
>>
>>
>> Quoting Robert Hicks <[hidden email]>:
>>
>>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>>> should have said that from the beginning. I just tried it using Cygwin
>>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>>> further than I was before!
>>>
>>> Basically the end goal is to be able to automate the creation of many
>>> feature types and this seems like the best way. The tool I'm planning
>>> on writing is going to be in Java so that it can run anywhere but if
>>> cURL is not platform independent that may be a problem.
>>>
>>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>>>>
>>>> Robert Hicks ha scritto:
>>>>>
>>>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>>>> against an instance of Geoserver running on another server. I'm trying
>>>>> to create a datastore remotely using the below command (copied from
>>>>>
>>>>>
>>>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>>>
>>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>>>> application/zip" --data-binary @states.zip
>>>>>
>>>>>
>>>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>>>
>>>> Hmmm... using the command line I often have to put the url between double
>>>> quotes:
>>>>
>>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>>>> --data-binary @states.zip
>>>>
>>>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>>>
>>>> Not sure if this is needed by curl as well, but may be worth a try.
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>>
>>>>> If fails with: curl: no URL specified!
>>>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>>>
>>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>>>> same error. Anyone with experience using this gotten it to work?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>
>>>>
>>>> --
>>>> Andrea Aime
>>>> OpenGeo - http://opengeo.org
>>>> Expert service straight from the developers.
>>>>
>>>
>>>
>>>
>>> --
>>> web http://www.hyxspace.com
>>> aim hyx1138
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by
>>>
>>> Make an app they can't live without
>>> Enter the BlackBerry Developer Challenge
>>> http://p.sf.net/sfu/RIM-dev2dev
>>> _______________________________________________
>>> Geoserver-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>
>
>
> --
> web http://www.hyxspace.com
> aim hyx1138
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
In reply to this post by lmorandini
Ah, great! That worked.

Okay so just to clarify, the url:
http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp
specifies the name of the new datastore to be created called roads,
and file.shp is just a generic name and the destination of the
uploaded shapefile?


On Wed, Aug 18, 2010 at 1:01 PM, Luca Morandini <[hidden email]> wrote:

> On 18/08/10 18:18, Robert Hicks wrote:
>> Luca, thanks for the response. Actually my mail client put those in
>> separate lines, I ran everything in on one line. As far as the second
>> failed call goes, that is kind of what I figured, but just wanted to
>> try using an existing datastore.
>
> OK, but did you try to run, *exactly*, the line I've posted ?
>
> You see, there are two differences worth noting:
>
> 1) 'Content-type: application/zip' (single quotes)
> 2) http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp
> (file.shp, not states.shp)
>
> If you ran it, what was the result ?
>
> --------------------
>    Luca Morandini
> www.lucamorandini.it
> --------------------
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
In reply to this post by christian.mueller-2
Hey Christian, maybe I'm looking at the wrong examples...if you are
using java.net.url, are you just making the same HTTP requests that
are made via PHP? I admit I didn't look at those examples, just the
cURL ones.

On Wed, Aug 18, 2010 at 10:33 PM,  <[hidden email]> wrote:

> My Java application runs in its own VM and uses the Java URL class. I am
> testing against 2.0.x at the moment, works fine. I will switch to
> geoserver-trunk because of the new Virtual Table feature, doing it the same
> way.
>
> What the hell are you doing with a packet sniffer ?. I simply looked at the
> REST examples, did the same within a java test app and started developing.
>
> Cheers
> Christian
>
>
> Quoting Robert Hicks <[hidden email]>:
>
>> Luca, thanks for the response. Actually my mail client put those in
>> separate lines, I ran everything in on one line. As far as the second
>> failed call goes, that is kind of what I figured, but just wanted to
>> try using an existing datastore.
>>
>> Christian, did you write a java application to interface with
>> Geoserver using sockets or is this an extension of the application
>> that has access to the underlying JVM? Like I mentioned in the very
>> first email, I have an application that does the former well with
>> 1.7.x versions of Geoserver but from poking around with a packet
>> sniffer with 2.0.x it seems almost impossible. Which version are you
>> using? I'd love to hear how you do it.
>>
>> On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:
>>>
>>> I configure geoserver with a java utility, no curl needed at all, Java
>>> has
>>> all you need :-)
>>>
>>> If you have problems coding with Java, please ask, I have simple to look
>>> up
>>> in my code.
>>>
>>>
>>> Quoting Robert Hicks <[hidden email]>:
>>>
>>>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>>>> should have said that from the beginning. I just tried it using Cygwin
>>>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>>>> further than I was before!
>>>>
>>>> Basically the end goal is to be able to automate the creation of many
>>>> feature types and this seems like the best way. The tool I'm planning
>>>> on writing is going to be in Java so that it can run anywhere but if
>>>> cURL is not platform independent that may be a problem.
>>>>
>>>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>>>>>
>>>>> Robert Hicks ha scritto:
>>>>>>
>>>>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>>>>> against an instance of Geoserver running on another server. I'm trying
>>>>>> to create a datastore remotely using the below command (copied from
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>>>>
>>>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>>>>> application/zip" --data-binary @states.zip
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>>>>
>>>>> Hmmm... using the command line I often have to put the url between
>>>>> double
>>>>> quotes:
>>>>>
>>>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>>>>> --data-binary @states.zip
>>>>>
>>>>>
>>>>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>>>>
>>>>> Not sure if this is needed by curl as well, but may be worth a try.
>>>>>
>>>>> Cheers
>>>>> Andrea
>>>>>
>>>>>
>>>>>> If fails with: curl: no URL specified!
>>>>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>>>>
>>>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>>>>> same error. Anyone with experience using this gotten it to work?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Andrea Aime
>>>>> OpenGeo - http://opengeo.org
>>>>> Expert service straight from the developers.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> web http://www.hyxspace.com
>>>> aim hyx1138
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> This SF.net email is sponsored by
>>>>
>>>> Make an app they can't live without
>>>> Enter the BlackBerry Developer Challenge
>>>> http://p.sf.net/sfu/RIM-dev2dev
>>>> _______________________________________________
>>>> Geoserver-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>>
>>>
>>>
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>>
>>
>>
>>
>> --
>> web http://www.hyxspace.com
>> aim hyx1138
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

lmorandini
In reply to this post by dnbphysicist
On 19/08/10 19:24, Robert Hicks wrote:
> Ah, great! That worked.

We live to please ;)


> Okay so just to clarify, the url:
> http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp
> specifies the name of the new datastore to be created called roads,
> and file.shp is just a generic name and the destination of the
> uploaded shapefile?

More precisely, "file.shp" declares what type of data has been sent in the POST
payload.

By the way, does the "-H" option work with double quotes instead of single ones
under Cygwin ?

Regards.

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

dnbphysicist
Yes, it works with both ' and "

Thanks again!

On Thu, Aug 19, 2010 at 1:44 PM, Luca Morandini <[hidden email]> wrote:

> On 19/08/10 19:24, Robert Hicks wrote:
>> Ah, great! That worked.
>
> We live to please ;)
>
>
>> Okay so just to clarify, the url:
>> http://10.10.0.20:8001/geoserver/rest/workspaces/gv/datastores/roads/file.shp
>> specifies the name of the new datastore to be created called roads,
>> and file.shp is just a generic name and the destination of the
>> uploaded shapefile?
>
> More precisely, "file.shp" declares what type of data has been sent in the POST
> payload.
>
> By the way, does the "-H" option work with double quotes instead of single ones
> under Cygwin ?
>
> Regards.
>
> --------------------
>    Luca Morandini
> www.lucamorandini.it
> --------------------
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



--
web http://www.hyxspace.com
aim hyx1138

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

Brian Ghigiarelli
In reply to this post by christian.mueller-2
Christian,

A few days before reading this thread, I started building my own Java client for the Geoserver REST API.  Any chance you would want to team up with what you've already got and open source it to create a distributable JAR?  (Unless anyone knows of an existing JAR solution for this that I'm not aware of...)

Thanks,
Brian

On Wed, Aug 18, 2010 at 10:33 PM, <[hidden email]> wrote:
My Java application runs in its own VM and uses the Java URL class. I
am testing against 2.0.x at the moment, works fine. I will switch to
geoserver-trunk because of the new Virtual Table feature, doing it the
same way.

What the hell are you doing with a packet sniffer ?. I simply looked
at the REST examples, did the same within a java test app and started
developing.

Cheers
Christian


Quoting Robert Hicks <[hidden email]>:

> Luca, thanks for the response. Actually my mail client put those in
> separate lines, I ran everything in on one line. As far as the second
> failed call goes, that is kind of what I figured, but just wanted to
> try using an existing datastore.
>
> Christian, did you write a java application to interface with
> Geoserver using sockets or is this an extension of the application
> that has access to the underlying JVM? Like I mentioned in the very
> first email, I have an application that does the former well with
> 1.7.x versions of Geoserver but from poking around with a packet
> sniffer with 2.0.x it seems almost impossible. Which version are you
> using? I'd love to hear how you do it.
>
> On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:
>> I configure geoserver with a java utility, no curl needed at all, Java has
>> all you need :-)
>>
>> If you have problems coding with Java, please ask, I have simple to look up
>> in my code.
>>
>>
>> Quoting Robert Hicks <[hidden email]>:
>>
>>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>>> should have said that from the beginning. I just tried it using Cygwin
>>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>>> further than I was before!
>>>
>>> Basically the end goal is to be able to automate the creation of many
>>> feature types and this seems like the best way. The tool I'm planning
>>> on writing is going to be in Java so that it can run anywhere but if
>>> cURL is not platform independent that may be a problem.
>>>
>>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>>>>
>>>> Robert Hicks ha scritto:
>>>>>
>>>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>>>> against an instance of Geoserver running on another server. I'm trying
>>>>> to create a datastore remotely using the below command (copied from
>>>>>
>>>>>
>>>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>>>
>>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>>>> application/zip" --data-binary @states.zip
>>>>>
>>>>>
>>>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>>>
>>>> Hmmm... using the command line I often have to put the url between double
>>>> quotes:
>>>>
>>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>>>> --data-binary @states.zip
>>>>
>>>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>>>
>>>> Not sure if this is needed by curl as well, but may be worth a try.
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>>
>>>>> If fails with: curl: no URL specified!
>>>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>>>
>>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>>>> same error. Anyone with experience using this gotten it to work?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>
>>>>
>>>> --
>>>> Andrea Aime
>>>> OpenGeo - http://opengeo.org
>>>> Expert service straight from the developers.
>>>>
>>>
>>>
>>>
>>> --
>>> web http://www.hyxspace.com
>>> aim hyx1138
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by
>>>
>>> Make an app they can't live without
>>> Enter the BlackBerry Developer Challenge
>>> http://p.sf.net/sfu/RIM-dev2dev
>>> _______________________________________________
>>> Geoserver-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>
>
>
> --
> web http://www.hyxspace.com
> aim hyx1138
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



--
Brian Ghigiarelli
570-878-9139

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

christian.mueller-2
In reply to this post by dnbphysicist
Yep, using Java it is like PHP. You develop an application using http  
requests for configuring geoserver.

curl is a (powerfull) command line utility, which you can use to  
configure geoserver with batch jobs.

For production environments with a large number of layers/slds, you  
should decide between these two possibilities.

For sophisticated configurations I would prefer using java/php. In my  
environment, my java app does the following

1) Remove all my workspaces from geoserver to have a clean starting point
2) Fetch meta information from a DB2 database, describing which layers  
are needed and how the should be rendered.
3) Create all workspaces,datastores, features, styles .... using REST

Cheers
Christian



Quoting Robert Hicks <[hidden email]>:

> Hey Christian, maybe I'm looking at the wrong examples...if you are
> using java.net.url, are you just making the same HTTP requests that
> are made via PHP? I admit I didn't look at those examples, just the
> cURL ones.
>
> On Wed, Aug 18, 2010 at 10:33 PM,  <[hidden email]> wrote:
>> My Java application runs in its own VM and uses the Java URL class. I am
>> testing against 2.0.x at the moment, works fine. I will switch to
>> geoserver-trunk because of the new Virtual Table feature, doing it the same
>> way.
>>
>> What the hell are you doing with a packet sniffer ?. I simply looked at the
>> REST examples, did the same within a java test app and started developing.
>>
>> Cheers
>> Christian
>>
>>
>> Quoting Robert Hicks <[hidden email]>:
>>
>>> Luca, thanks for the response. Actually my mail client put those in
>>> separate lines, I ran everything in on one line. As far as the second
>>> failed call goes, that is kind of what I figured, but just wanted to
>>> try using an existing datastore.
>>>
>>> Christian, did you write a java application to interface with
>>> Geoserver using sockets or is this an extension of the application
>>> that has access to the underlying JVM? Like I mentioned in the very
>>> first email, I have an application that does the former well with
>>> 1.7.x versions of Geoserver but from poking around with a packet
>>> sniffer with 2.0.x it seems almost impossible. Which version are you
>>> using? I'd love to hear how you do it.
>>>
>>> On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:
>>>>
>>>> I configure geoserver with a java utility, no curl needed at all, Java
>>>> has
>>>> all you need :-)
>>>>
>>>> If you have problems coding with Java, please ask, I have simple to look
>>>> up
>>>> in my code.
>>>>
>>>>
>>>> Quoting Robert Hicks <[hidden email]>:
>>>>
>>>>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>>>>> should have said that from the beginning. I just tried it using Cygwin
>>>>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>>>>> further than I was before!
>>>>>
>>>>> Basically the end goal is to be able to automate the creation of many
>>>>> feature types and this seems like the best way. The tool I'm planning
>>>>> on writing is going to be in Java so that it can run anywhere but if
>>>>> cURL is not platform independent that may be a problem.
>>>>>
>>>>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]> wrote:
>>>>>>
>>>>>> Robert Hicks ha scritto:
>>>>>>>
>>>>>>> Okay so I have cURL installed locally and I'm trying to run some tests
>>>>>>> against an instance of Geoserver running on another server. I'm trying
>>>>>>> to create a datastore remotely using the below command (copied from
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html)
>>>>>>>
>>>>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>>>>>>> application/zip" --data-binary @states.zip
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>>>>>>
>>>>>> Hmmm... using the command line I often have to put the url between
>>>>>> double
>>>>>> quotes:
>>>>>>
>>>>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>>>>>> --data-binary @states.zip
>>>>>>
>>>>>>
>>>>>> "http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp"
>>>>>>
>>>>>> Not sure if this is needed by curl as well, but may be worth a try.
>>>>>>
>>>>>> Cheers
>>>>>> Andrea
>>>>>>
>>>>>>
>>>>>>> If fails with: curl: no URL specified!
>>>>>>> curl: try 'curl --help' or 'curl --manual' for more information
>>>>>>>
>>>>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get the
>>>>>>> same error. Anyone with experience using this gotten it to work?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Andrea Aime
>>>>>> OpenGeo - http://opengeo.org
>>>>>> Expert service straight from the developers.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> web http://www.hyxspace.com
>>>>> aim hyx1138
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> This SF.net email is sponsored by
>>>>>
>>>>> Make an app they can't live without
>>>>> Enter the BlackBerry Developer Challenge
>>>>> http://p.sf.net/sfu/RIM-dev2dev
>>>>> _______________________________________________
>>>>> Geoserver-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>>>
>>>>
>>>>
>>>>
>>>> ----------------------------------------------------------------
>>>> This message was sent using IMP, the Internet Messaging Program.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> web http://www.hyxspace.com
>>> aim hyx1138
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>
>
>
> --
> web http://www.hyxspace.com
> aim hyx1138
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Geoserver REST Question

christian.mueller-2
In reply to this post by Brian Ghigiarelli
No problem, I could make my source available if you like. At the  
moment I have no access to the source, you should ping me next week  
again.

In my opinion, it does not make sense to create a java application  
using REST doing the same as the geoserver GUI. Batch configurations  
are individual and depend on your situation.

But I think it would make sense to have something like this for php
http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-php.html

A similar documentation for java would help. Looking at my personal  
time schedule, I could start after 13th of September.

If you are interested, we could merge our Java experience and I will  
create the  documentation (which is written in sphinx).  Our you can  
do that and I will assist you. Again, give me a ping if you are still  
interested behind 13th of September.

Cheers
Christian


Quoting Brian Ghigiarelli <[hidden email]>:

> Christian,
>
> A few days before reading this thread, I started building my own Java client
> for the Geoserver REST API.  Any chance you would want to team up with what
> you've already got and open source it to create a distributable JAR?
>  (Unless anyone knows of an existing JAR solution for this that I'm not
> aware of...)
>
> Thanks,
> Brian
>
> On Wed, Aug 18, 2010 at 10:33 PM, <[hidden email]> wrote:
>
>> My Java application runs in its own VM and uses the Java URL class. I
>> am testing against 2.0.x at the moment, works fine. I will switch to
>> geoserver-trunk because of the new Virtual Table feature, doing it the
>> same way.
>>
>> What the hell are you doing with a packet sniffer ?. I simply looked
>> at the REST examples, did the same within a java test app and started
>> developing.
>>
>> Cheers
>> Christian
>>
>>
>> Quoting Robert Hicks <[hidden email]>:
>>
>> > Luca, thanks for the response. Actually my mail client put those in
>> > separate lines, I ran everything in on one line. As far as the second
>> > failed call goes, that is kind of what I figured, but just wanted to
>> > try using an existing datastore.
>> >
>> > Christian, did you write a java application to interface with
>> > Geoserver using sockets or is this an extension of the application
>> > that has access to the underlying JVM? Like I mentioned in the very
>> > first email, I have an application that does the former well with
>> > 1.7.x versions of Geoserver but from poking around with a packet
>> > sniffer with 2.0.x it seems almost impossible. Which version are you
>> > using? I'd love to hear how you do it.
>> >
>> > On Mon, Aug 16, 2010 at 9:33 AM,  <[hidden email]> wrote:
>> >> I configure geoserver with a java utility, no curl needed at all, Java
>> has
>> >> all you need :-)
>> >>
>> >> If you have problems coding with Java, please ask, I have simple to look
>> up
>> >> in my code.
>> >>
>> >>
>> >> Quoting Robert Hicks <[hidden email]>:
>> >>
>> >>> Thanks for the responses everyone! I am on Windows using DOS, sorry
>> >>> should have said that from the beginning. I just tried it using Cygwin
>> >>> and now it says 'No such datastore: gv,roads'. So I'm guessing that is
>> >>> further than I was before!
>> >>>
>> >>> Basically the end goal is to be able to automate the creation of many
>> >>> feature types and this seems like the best way. The tool I'm planning
>> >>> on writing is going to be in Java so that it can run anywhere but if
>> >>> cURL is not platform independent that may be a problem.
>> >>>
>> >>> On Sat, Aug 14, 2010 at 5:38 PM, Andrea Aime <[hidden email]>
>> wrote:
>> >>>>
>> >>>> Robert Hicks ha scritto:
>> >>>>>
>> >>>>> Okay so I have cURL installed locally and I'm trying to run some
>> tests
>> >>>>> against an instance of Geoserver running on another server. I'm
>> trying
>> >>>>> to create a datastore remotely using the below command (copied from
>> >>>>>
>> >>>>>
>> >>>>>
>> http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html
>> )
>> >>>>>
>> >>>>> My command: curl -u admin:password -XPUT -H "Content-type:
>> >>>>> application/zip" --data-binary @states.zip
>> >>>>>
>> >>>>>
>> >>>>>
>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>> >>>>
>> >>>> Hmmm... using the command line I often have to put the url between
>> double
>> >>>> quotes:
>> >>>>
>> >>>> curl -u admin:password -XPUT -H "Content-type: application/zip"
>> >>>> --data-binary @states.zip
>> >>>>
>> >>>> "
>> http://10.10.0.20:8001/geoserver/rest/workspaces/workspace/datastores/roads/states.shp
>> "
>> >>>>
>> >>>> Not sure if this is needed by curl as well, but may be worth a try.
>> >>>>
>> >>>> Cheers
>> >>>> Andrea
>> >>>>
>> >>>>
>> >>>>> If fails with: curl: no URL specified!
>> >>>>> curl: try 'curl --help' or 'curl --manual' for more information
>> >>>>>
>> >>>>> So I tried --url http://10.10.0.20:8001/geoserver/rest, but I get
>> the
>> >>>>> same error. Anyone with experience using this gotten it to work?
>> >>>>>
>> >>>>> Thanks in advance!
>> >>>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Andrea Aime
>> >>>> OpenGeo - http://opengeo.org
>> >>>> Expert service straight from the developers.
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> web http://www.hyxspace.com
>> >>> aim hyx1138
>> >>>
>> >>>
>> >>>
>> ------------------------------------------------------------------------------
>> >>> This SF.net email is sponsored by
>> >>>
>> >>> Make an app they can't live without
>> >>> Enter the BlackBerry Developer Challenge
>> >>> http://p.sf.net/sfu/RIM-dev2dev
>> >>> _______________________________________________
>> >>> Geoserver-users mailing list
>> >>> [hidden email]
>> >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>> >>>
>> >>
>> >>
>> >>
>> >> ----------------------------------------------------------------
>> >> This message was sent using IMP, the Internet Messaging Program.
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > web http://www.hyxspace.com
>> > aim hyx1138
>> >
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by
>>
>> Make an app they can't live without
>> Enter the BlackBerry Developer Challenge
>> http://p.sf.net/sfu/RIM-dev2dev
>> _______________________________________________
>> Geoserver-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>
>
>
> --
> Brian Ghigiarelli
> 570-878-9139
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users