In the PowerServer project painter, select the .NET Server page > Basic tab, specify the Web API URL, for example, http://172.16.100.35:82.
If your database and Web APIs reside in different servers, you will need to create a new database cache so that the Web APIs can connect with the remote database at runtime.
Step 1: In the PowerServer project painter, select the Database page > Advanced tab, click New in the upper part to create the database connection.
Step 2: In the dialog box that displays, specify the settings for the database connection.
The following uses the PB demo database for SQL Anywhere as an example.
-
Select SQL Anywhere (ODBC) from the Provider list.
-
Specify "sales_remotedb" (or any text you like) as the database cache name in the Cache name field.
-
Select the ODBC data source that connects with the remote database.
-
Specify "dba" as the user name and "sql" as the password.
Step 3: Select the option "I have read and agree to the license ...".
Step 4: Click Test connection to make sure the database can be connected successfully.
Step 5: Click OK to save settings and go back to the Advanced tab; and then click New in the lower part to map the transaction object with the database cache.
Step 6: Input "sqlca" as the transaction object that maps to the database cache.
Note
If firewall is turned on in your database server, make sure to configure the firewall to allow the database port number to go through.
If you are deploying to a production server, you might want to use a production license for PowerServer, instead of using a developer license. To use a production license, you will need to export the license file from the Appeon website and then import the license to the PowerServer project.
Step 1: Log into the Appeon User Center, click License Management, and then click All Licenses under PowerServer.
Step 2: Click View, and then click Export to export the license code to a TXT file ([LicenseKey].txt) and save the file on the local machine.
Do not change the file name, as the file name represents the unique license key.
Step 3: Go to the .NET Server page of the PowerServer project painter, and then click Import From File to select and import the [LicenseKey].txt file.
Save the PowerServer project settings; and build the PowerServer project (using the Build & Deploy PowerServer Project button) for the changes to take effect.
Note
If you want to deploy to an existing PowerServer C# solution, make sure the "Overwrite server settings (DB Connection, .NET server listening port, and license)" option is selected in the .NET Server page > Advanced tab, otherwise the solution will not be updated with the Web API port number (used in local development environment), the database cache, and the production license.
When the process is finished, manually open the specified location (by default C:\Users\appeon\source\repos\PowerServer_salesdemo) and double click the .sln file to open the PowerServer C# solution in SnapDevelop.
Double check the database cache settings in the ServerAPIs project > AppConfig > Applications.json file.
Double check the license in the ServerAPIs project > Server.json file.
Double check the Web API port number in ServerAPIs project > Properties > launchSettings.json file, if you want to run the Web APIs directly in the local development environment (for example, from the SnapDevelop IDE).