Modifying and re-deploying the PowerServer project

The following modifications are made to the PowerServer project created in the Quick Start guide and modified in Tutorial 1. If you have not created a PowerServer project yet, please follow the instructions in the Quick Start guide and Tutorial 1 to create one.

Step 1: Specify where the Web APIs is actually hosted and run. This tells the client app where and how to call the Web APIs.

On the Web APIs tab of the PowerServer project painter, specify the URL of the docker container where the Web APIs is running. The host name (or IP address) of the docker container should be the same as that of the docker host/Docker Engine. The port number is what will be specified later when the docker container is run, for example, http://172.16.100.20:5009. This indicates that the client app will call the Web APIs running on the docker container at http://172.16.100.20:5009.

Important

  1. Make sure the docker container is run at the same host name (or IP address) and port number. For how to run the image as a container, see the next section Publishing Web APIs to Docker.

  2. If the host name and port number of the docker container are changed later, you will need to modify the settings here and then deploy the project again (using the "Build & Deploy PowerServer Project" option).


Step 2: Configure the database connection.

  1. At the bottom of the Web APIs tab of the PowerServer project painter, click the Database Configuration button.

  2. In the Database Configuration dialog, click New in the upper part to create the database connection that will be used by the deployment.

  3. Configure the database connection settings (using the PBDemo PostgreSQL database in this tutorial).

    If the following errors occur when testing the connection, try the following solutions:

    • "Exception while connecting"

      Solution: make sure the firewall on the database server has been configured to allow the database port 5432 (detailed instructions).

    • "28000: no pg_hba.conf entry for host "172.16.100.104", user "postgres", database "postgres", SSL off"

      Solution: edit the %PostgreSQL%\12\data\pg_hba.conf file to allow remote connections (detailed instructions).


  4. Select the database cache you created just now and map it to the "sqlca" transaction object.


Step 3: Save the PowerServer project settings.

Step 4: Build and deploy the PowerServer project (using the "Build & Deploy PowerServer Project" option) for the changes to take effect.