You can also deploy the Web API to a folder first and then manually copy the folder's content to the IIS site folder:
Step 1: In the PowerServer project painter, select the Deploy page > Basic tab.
Step 2: Select External as the target run mode, and then select Folder as the target server.
Step 3: Specify to generate the package as an Executable installer or a Zipped file.
If you select Zipped file, an appname.zip file is generated in the specified path. You can copy the zip file to the server and then decompress it to the web root.
If you select Executable installer, an appname.exe file is generated in the specified path. You can copy the executable file to the server and then run it to install the application to the web root.
Step 4: Specify to package the PowerServer Web APIs as Framework-dependent or Self-contained package, for Portable, Windows 64-bit, Linux 64-bit, or Windows 32-bit platform.
-
Framework-dependent or Self-contained -- A Self-Contained package will not only include the app assembly files and its dependencies, but also include the .NET Core runtime and libraries. Users can run it on a machine that has no .NET Core runtime installed. A Framework-Dependent package will only include the app assembly files and its dependencies. Users have to install the .NET Core runtime in order to run the app.
-
Portable, Windows 64-bit, Linux 64-bit, or Windows 32-bit -- The target platform that the Web APIs is published for. If you know the architecture of the target server, you can select the corresponding platform; if you are not sure of the server architecture, you can select Portable. But if you select Portable, you can only select Framework-dependent.
Note
Make sure the platform of Web APIs matches that of the server. Take IIS for example, if you select Windows 32-bit, make sure IIS is 32-bit ("Enable 32-Bit Applications" is set to True); if you select Windows 64-bit, make sure IIS is 64-bit ("Enable 32-Bit Applications" is set to False). For more, refer to this section.
Step 5 (Optional): Specify the Web API URL if you know where the Web APIs will be running. If you are not sure where the Web APIs will be running, you can leave this field empty and specify the URL later in the client app > apprun.json.
Step 6: Specify the folder and file name where the package will be generated. You can select to delete all existing files in the zip file before packaging.
Step 7: Click the Build & Deploy Project button from the toolbar to generate the package.
Step 8: Unzip the package or run the executable installer.
You will get the following sub-folders and file:
-
the "CloudAppPublisher" folder which contains the cloud app launcher and the PowerBuilder runtime files
-
the "[appname]" folder (named after the App name configured in IDE, for example "salesdemo_cloud") which contains the application files
-
the "[solutionname]_API" folder which contains the compiled PowerServer Web APIs
-
the web.config file used by IIS to launch the PowerServer Web APIs
Step 9: Copy all files from the "[solutionname]_API" sub-folder to the server.
Suppose the server is running IIS with IP address 172.16.100.83, port number 81, and physical path C:\inetpub\testsite_root; then you should copy all files to C:\inetpub\testsite_root, as shown below.
After that, the IIS process manager will automatically launch the Web APIs when http://172.16.100.83:81 is accessed.
Although you don't need to start the Web APIs manually, you can verify the Web APIs by following the instructions in the next section: Verifying the Web APIs.
But before you can run the installable cloud application, you might need to adjust the following settings first:
-
Change the value of the Web API URL stored in the client app > apprun.json file. See this section for more details.
-
If you use the SQL Anywhere database or ASE database which supports only ODBC connection at this moment, you will also need to set up the corresponding ODBC data source on the server where Web APIs is deployed and running.