In this tutorial, we will set up the .NET server (where Web APIs will run) in an independent machine; and we will run the Web APIs with the built-in Kestrel server.
Step 1: Set up the .NET server with the following OS and software:
-
Windows Server 2019 (64-bit)
-
SQL Anywhere 17
Step 2: (IMPORTANT) Configure Secure Sockets Layer (SSL) for the .NET server, so that HTTPS can be used to secure the connections between the client and the .NET server.
Step 3: Make sure the .NET server can connect to the Appeon license server (for activating and validating the PowerServer license).
Note
If the server connects to Internet through a proxy server, make sure to configure the proxy server settings in the PowerServer Web API as well (the ServerAPIs project > Server.json file > "ProxyOptions" block). The password for the proxy server (if any) must be an encrypted value (encrypted by the CustomizeDeploy.dll tool).
Step 4: If firewall is turned on in the .NET server, configure it to allow the port number (5009 in this tutorial or any port number you choose). The section "Configuring Windows Defender Firewall" has detailed instructions.
Note
For optimal runtime performance, it is highly recommended that the PowerServer Web APIs should be published to a server that locates on the same LAN as the database server. If the database is not on the same network as the Web APIs, every request has to go a long way from PowerServer to the database, it is highly possible that there will be performance and security issues.
This section is required only when the SQL Anywhere or ASE database is used.
A database connection needs to be established between the development PC and the database server (for converting DataWindows to models), and between the .NET server and the database server (for retrieving data). Currently the SQL Anywhere database can only be connected through an ODBC driver, therefore, you will need to create the same ODBC data source in both:
-
the development PC, and
-
the .NET server
Step 1: Install SQL Anywhere 17.
Step 2: Create a 64-bit ODBC data source and name it as "SalesDemo DB". The data source name must be the same in both the development PC and the .NET server. The data source should connect to the salesdemo SQL Anywhere database server (which is set up in Setting up the database server).
IMPORTANT: Make sure you use the 64-bit version of ODBC administrator to create the data source, because only the 64-bit ODBC data sources are supported by PowerServer.
Step 3: Click Test Connection to ensure the connection settings are correct.
In the test and development environment, you may run the Web APIs with the built-in Kestrel server; while in the production environment, it is recommended that you deploy and host the Web APIs in a more secure and manageable environment such as Docker Container, IIS etc. as described in the following tutorials.