3

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>" + 
                      "</dataStore>";

        return xml;

    }

I'm using GeoServer 2.1.3 and PostGIS 1.5.

1 Answer 1

1

Use this tag for password, where password@123 is the password here

<passwd>password@123<passwd/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.