The PSIGEN Affinity API and Server work together to allow a variety of PSIGEN products, as well as custom applications, to communicate with your PSIsafe 32-bit installation via the Azure API Management Service. This not only allows 64-bit applications to work with your PSIsafe installation, but also allows programmers to create custom programs that can send and receive data as it suits your unique business application needs. Below is a breakdown of the PSIGEN Affinity API and Server deployment process.
- Internet Information Services and IIS Manager. Required to host Affinity API in IIS on your server. See detailed requirements for specific Server Roles required below (referred to as Windows Features in Windows 10).
WEB SERVER IIS (Server Roles):
Common HTTP Features:
- Default Document
- Static Content
Health and Diagnostics:
- HTTP Logging
- Request Monitor
- Static Content Compression
- Request Filtering
- Windows Authentication
- .NET Extensibility 4.7
- ASP.NET 4.7
- ISAPI Extensions
- ISAPI Filters
IIS 6 Management Console
PSIsafe 32-Bit Server version 188.8.131.527 or later
PSIsafe Desktop Client and Manager version 184.108.40.2067 or later
Note: The Affinity API and Server runs independently of the PSIsafe Desktop Client and 32-Bit Server. However they are required when setting up a PSIsafe database and to run PSIsafe Management for registration and management.
ASP.Net Core 3.1.6 or later Hosting Bundle: "https://dotnet.microsoft.com/download/dotnet-core/3.1 "
Note: If you are developing an application utilizing the Affinity API you need to install the .Net Core 3.1.6 or later framework.
Important: Make sure that you install IIS BEFORE the Hosting Bundle. If not you will get a 500.19 Internal Server error when you try to run the API web site. To fix this perform a repair (re-install) of the Hosting Bundle.
If you are NOT a member of the PSIGEN Engineering team please use deployment package provided by PSIGEN. If you need assistance downloading a deployment package, Contact PSIGEN Support.
If you are a member of the PSIGEN Engineering team, you can get the latest build of Affinity API/Affinity Server from Azure DevOps "https://dev.azure.com/psigensoftware/PSIsafe Affinity API/_build"
In Azure DevOps drill down to the build you want to download and then select the Artifacts as seen in screen shot below and download API and Server.
Make sure you Unblock downloaded ZIP files if blocked. Check Unblock and then press Apply:
Affinity Server/Service Deployment
Create folder C:\Program Files\PSIsafe\AffinityServer.
Extract the contents of server.zip.
Move the contents of server/server to the folder C:\Program Files\PSIsafe\AffinityServer.
If you have registered PSIsafe. Copy CNGDBList.XML from C:\Program Files (x86)\CNG\CNGServer to C:\Program Files\PSIsafe\AffinityServer.
Open an administrative command prompt and run install.bat located in C:\Program Files\PSIsafe\AffinityServer\scripts.
Open up Windows Services and ensure that you see an entry for "PSIGEN Affinity Server"
Make sure the service is running and that Startup Type is set to Automatic.
Note: If you need to remove a service you can:
- Use Powershell 7 or later with the command below:
Remove-Service -Name "PSIGEN.Affinity.Service"
- If you have Powershell V5:
* Open Windows PowerShell ISE * Paste the following two lines: * $service = Get-WmiObject -Class Win32_Service -Filter "Name='PSIGEN.Affinity.Service'" * $service.delete() * Run the script with F5 or pressing the play button
- Use command prompt (with Administrator privileges) with the command below:
sc delete "PSIGEN.Affinity.Service"
Affinity API Deployment
- Extract the contents of api.zip to a folder path such as C:\Program Files\PSIsafe\AffinityAPI
- Open IIS (Internet Information Services)
- Right click Application Pools and Add a new App pool. Suggested name "AffinityAPI"
- Create a web site or an application below the Default Web Site.
- Administrators may wish to name the site AffinityAPI.
- The Website files are from step one  (example C:\Program Files\PSIsafe\AffinityAPI)
- Assign the Application Pool to the web site/application.
Important: Make sure the Affinity API Web Site is utilizing an HTTPS type binding. Additionally, if the Administrator does not have access to an SSL Certificate, one may need to be purchased.
Test that your API deployment is functional
1: In IIS Manager. Right select your AffinityAPI Web Site (Production) or AffinityAPI Application under Default Web Site.
2: Select Browse on the right side in IIS Manager:
/API to the URL in the browser
For example https://localhost:443/api (with certificate) or http://localhost/affinityapi/api (without certificate).
4: Verify that you see something similar to the following
5. Test that the API can connect to your PSIsafe Database by appending the following to the URL: /databases?customercode=default
This should display a screen similar to the following (a list of PSIsafe databases visible to the Affinity API):
If this step fails. Double check that you performed the step above:
Copy CNGDBList.XML from C:\Program Files (x86)\CNG\CNGServer to C:\Program Files\PSIsafe\AffinityServer
Add Write Permissions to applogs folder in API
This is required so that Affinity App Pool can write to the logs.
In IIS Manager:
1: Find the applog folder for the Affinity API.
2: Right click and select Edit Permissions
3: Open Security Tab.
4: Select Edit.
5: Click Add..
6: Key in "iis apppool\affinityapi" (where affinityapi is the name of the app pool used for Affinity API.
7: Click Check Names. And then OK.
Test that API and Affinity Server are deployed and configured properly
To test do the following in IIS Manager:
1: Select your AffinityAPI Web Site (or application under Default Web Site).
2: Select Browse in the Actions Panel in IIS Manager.
Note: Your configuration may be different based on where you deployed the Affinity API and if you have a certificate configured.
3: Add /API to the URL in the web browser. For example:
This should display he following in the browser:
4: Append the following to the URL:
This will connect to the PSIsafe SQL DB and return one or more database names (as configured in PSIsafe Management)