The simple Init() method only works with the .Net Framework because it tries to log in with the current Windows user and selects the first available DMS server.
Choosing the Right DMS Server
The Init() method has an optional parameter for selecting a specific DMS server. There are environments where more than one DMS server is connected to a LEXolution Service Bus. In such cases, it's necessary to choose one. The SystemSelection parameter exists as an optional parameter in all overloads of the Init method. If not specified (null), the First strategy is used.
var systemSelection = SystemSelection.Id(databaseId);
dms.Init(systemSelection); There are two possible selection strategies that can be called via static methods on SystemSelection:
First
SystemSelection.First() This uses the DMS system that responds first. In environments with only one DMS server, this is the simplest option. However, if multiple DMS servers are present, this is not a sensible strategy.
Id
SystemSelection.Id(databaseId) This establishes a connection only when the specified DMS system responds. All others are ignored. The databaseId is found in the table tblDatabaseId in the database connected to the DMS server. If the DMS system is a cluster, meaning multiple DMS servers all connected to the same database, the connection is made to the cluster node that responds first.
Logging in with a Specific User
dms.Init(username, password, systemSelection); The login is performed with the specified user both in the STP user management and directly on the DMS server. Depending on availability, one of the two login systems is used automatically. However, impersonation (if the user has the appropriate permissions) is only available later in the case of STP user management.
Logging into an Existing Queue
If an authenticated (STP user management) and encrypted connection to the LEXolution Service Bus already exists in the application, this connection can also be used for the API.
dms.Init(existingServiceQueue, systemSelection);However, it is recommended to use a separate queue for the API so that it can be easily cleaned up later and to avoid potential conflicts with impersonation among other users.
Checking LSB Availability
The API uses LSB (RabbitMQ). The availability of this transmission technology can be easily determined:
var lsbActive = dms.IsLsbAvailable();In the background, the function of the LSB QueueFactory.IsLsbAvailable() is called with the relevant parameters.
Checking the Reachability of the DMS Server
Query whether the DMS server is reachable:
var serverAlive = dms.IsDocumentsOnPremiseServerAlive();Related to