The SCEX Loan Server Service
As mentioned in the introductory chapter of this reference manual, the SCEX Loan Server goes one step beyond the SCEX, turning the SCEX into a multi-platform calculation engine, allowing applications on non-Windows platforms to harness the power of the SCEX.
The SCEX Loan Server provides a TCP/IP communication wrapper around the SCEX. As long as the platform on which your application resides can communicate via TCP/IP, you can use the Sherman Calculation Engine in your product.
The SCEX Loan Server is a 32-bit Windows 2000 / XP / 2003 service. The Loan Server listens on a specified port for incoming loan calculation requests. When it receives a loan request, the Loan Server dispatches the SCEX XML loan request to the SCEX. Once the SCEX returns an XML result, the SCEX Loan Server then returns the XML result buffer to the client via TCP/IP.
Installation and Administration
The SCEX Loan Server Service is provided as an optional installation component in the main SCEX installer application. Refer to the Installation chapter for further details on how to install the SCEX Loan Server service.
Important: Since the SCEX Loan Server is a service and will run without a logon, it is best to install the service and all related files in a local subdirectory (i.e., NOT located on a network drive).
Once installed, the SCEX Loan Server will automatically start and configure itself to launch whenever the computer restarts. The service will appear as "SCEX Loan Server" in the Windows Services application.
To access Services:
- Click
Start
. - Choose
Run...
and typeSERVICES.MSC
.
From there, you can start, pause, resume, and stop the service.
Configuration
When the service first starts, it creates a configuration file called
LoanServerService.INI
with default values. You can modify these key-value
pairs using any text editor. To apply changes:
- Pause the SCEX Loan Server service.
- Resume the service, which will read and implement the new values.
Default Configuration:
[Settings]
Port=8000
TimeOut=30
[Logging]
Enabled=0
LogLevel=0
FileName=C:\LoanServerLog.txt
General Settings
- Port: The port number on which the server listens for client connections.
- Timeout: The number of seconds a client connection can remain idle before being automatically disconnected.
Logging Settings
- Enabled: Whether file logging is enabled (
1
) or disabled (0
). - LogLevel: Specifies the detail of the logs:
0
: Minimal (errors, service start/stop/pause/resume).1
: Adds details for connections (remote address, loan processed, disconnection).2
: Logs XML input from the client.3
: Logs XML output sent to the client.
- FileName: The path of the log file. Note: If logging is enabled, monitor the file size periodically as it will grow over time.
Usage
To use the SCEX Loan Server Service, the client application must:
-
Establish a TCP/IP connection to the server's IP address, specifying the appropriate port (default:
8000
). -
Send an XML request formatted as follows:
<BEGIN DATA> ...normal XML input query goes here... <END DATA>
-
The server will process the query and return the result in the following format:
RESULT-CODE: ### RESULT-LENGTH: ### ...normal XML result query goes here...
Response Format:
- RESULT-CODE: Numeric result of the processed query. Refer to Table 3.1 for code meanings.
- RESULT-LENGTH: The character length of the XML result body (excluding the header).
The header ends with a blank line. If RESULT-LENGTH > 0
, the body of the
response follows the header.
After sending the result, the server will disconnect the client automatically.
Persistent Connections
If you need to send multiple XML requests in quick succession, persistent connections can be used to avoid creating a new TCP/IP connection for each request. For this, wrap the XML query in:
<BEGIN PDATA>
...XML query...
<END PDATA>
This method keeps the TCP/IP connection open after the result is sent, ready to receive another XML envelope. Note: The timeout value still applies, so idle connections will be disconnected.