Hi community,

I am trying to add an existing postgis table into geoserver 2.1 form the
command line on a Windows 7 machine. I have tried both the terminal and
cygwin with the same results described below.

The geoserver supporting documentation (
http://docs.geoserver.org/stable/en/user/restconfig/rest-config-examples/rest-config-examples-curl.html)
shows that it should be a simple curl command to do this. I have tried the
following (and several modifications of it) using an existing workspace
(tourism) and data store (autoPGT) set up at
http://localhost:8081/geoserver/web/ .... in the commands I have tried, I
use my actual user name and password (that I would use to log into the web
interface) instead of myusername:mypwd

C:\Users\admin\Downloads\curl_726_0\curl.exe -u myusername:mypwd -XPOST -H
“Content-type: text/xml” -d
“<featureType><name>nccamp_test</name></featureType>”
http://localhost:8081/geoserver/rest/workspaces/tourism/datastores/autoPGT/featuretypes



This results in an error: "< was unexpected at this time"
I have no idea what this issue is about??

To work around the "<" issue, I found that I could save the following
string <featureType><name>nccamp_test</name></featureType> as an xml file.
When I try the following command I get a different error.

C:\Users\admin\Downloads\curl_726_0\curl.exe –u myusername:mypwd -XPOST -T
C:\Users\admin\Desktop\StacyProj\geoserver\nccamp.xml -H "Content-type:
text/xml"
http://localhost:8081/geoserver/rest/workspaces/tourism/datastores/autoPGT/featuretypes


The resulting error:
curl: (6) Could not resolve host: -u; Host not found
curl: (6) Could not resolve host: myusername:mypwd; No data record of
requested
type
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 401 Full authentication is required to access this
resource</title>

</head>
<body><h2>HTTP ERROR: 401</h2><pre>Full authentication is required to
access thi
s resource</pre>
<p>RequestURI=/geoserver/rest/workspaces/tourism/datastores/autoPGT/featuretypes
</p><p><i><small><a href="http://jetty.mortbay.org/";>Powered by
Jetty://</a></sm
all></i></p><br/>
<br/>
<br/>
...
...
<br/>
<br/>

</body>
</html>

This error "Error 401 Full authentication is required to access this
resource" makes me think that I do not have all of the critical information
included in this call, but I am not sure what I am missing because it looks
like the example on the docs page.

Any thoughts would be appreciated!

Cheers,
Stacy
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to