Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm passing the XML created by the method below to a GeoServer REST API request that successfully creates a postGIS data store. However, password is not persisted. I have to update the password manually in the data store. I need the password to be saved for subsequent requests using the data store to be successful. Any suggestions on what I can do for the password to be saved?

    private string getDbXml(string dsName)
        string dbHost = "localhost";
        string dbPort = "5432";
        string dbName = "testgis";
        string dbUser = "mydbuser";
        string dbPassword = "mydbpassword";
        string dbType = "postgis";
        string exposePKsParameter = "<entry key=\"Expose primary keys\">true</entry>";

        string xml = "<dataStore>" +
                        "<name>" + dsName + "</name>" + 
                        "<enabled>true</enabled>" + 
                        "<connectionParameters>" + 
                            "<host>" + dbHost + "</host>" + 
                            "<port>" + dbPort + "</port>" + 
                            "<database>" + dbName + "</database>" + 
                            "<user>" + dbUser + "</user>" + 
                            "<password>" + dbPassword + "</password>" +
                            "<dbtype>" + dbType + "</dbtype>" + 
                            "<namespace>" + dsName + "_NS</namespace>" + 
                            exposePKsParameter + 
                         "</connectionParameters>" + 

        return xml;


I'm using GeoServer 2.1.3 and PostGIS 1.5.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.