Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

TWebServices is built-in component TWebServices and TServer are components within the software platform. TWebServices It enables external interactions by providing a web interface and APIs, enabling allowing for remote system monitoring, control, and integration with other software components. TServer is the backbone for internal processes, handling data exchange and communication between devices and software modules via WebSockets for real-time, bidirectional connectivity. It also manages system configuration and a shared real-time database, supporting the functionalities that TWebServices makes accessible externally, thus ensuring seamless operation and integration across the platform 

The TWebServices is simple solution, no configuration required, it implements the execution of Web Services, including the TProjectServer service, necessary to allow remote to access to the solution configuration.
The product installation, by default, uses the port 10108 and the entry point for TWebServices.

On this page:

Table of Contents
maxLevel3
stylenone


TWebServices Setup

When is Required

TWebServices is not automatically set up to run as a Windows service during product installation. Enabling it is only necessary if you want the solution files on your computer to be accessible to configuration tools or the SolutionsManager tool on a remote computer. Enabling this service also allows SolutionsManager WebUI access.
When the service is enabled, you can open the URL http://<Server IP or Name>:10108/solutions from another computer where the product is not installed.
Example: http://192.169.1.1:10108/solutions

This URL will launch SolutionsManager on the remote computer, providing access to the solution files on the target computer.

Setup Process

In order to enable the execution of TWebServices, just follow the steps:

Step 1 - Open FrameworX, then navigate to the "Server Information", with a mouse-click on the title "Server Information", on the top-left side of the screen.

Image Added

Step 2   In Add Services, click WebServices and Ok

Image Added

After installation is complete:

Image Added


Tip

If Windows open a dialog requesting Security elevation, accept it. 

The Command prompt window will close automatically after the setup process is concluded. 

The "Process Running" field in the Server Information dialog, doesn't have background refresh. If you want to know if the services are running (or if a solution is running with the TServer process), click the refresh icon.Image Added


Image Added


Execution in Linux and Other Platforms

The process described can only be executed in a Windows Computer, as the web ui for the Solutions Manager doesn't have the options to setup services. 

To install on Linux, you can manually copy the files from the windows installation folder, located in the subfolder, "FrameworX/net8.0/", copying it to Linux folder "/home/FrameworX/", and run the TWebServices from there, or you can use the automated tools to install the software components in Linux. 

For more information, go to the page Linux Deployment.


AutoStart for Solutions or Other Programs

The TWebServices can be setup to run automatically solutions, or other programs, when it starts its execution. 

Typically, in production environments, the TWebServices is set to run as a WindowsService in Windows when computer in on, or it is included it start the device is powered on in Linux and Docker images.

 Either way, when TWebServices.exe starts its execution, it will look for the configuration file TWebServicesRunPrograms.json. The RunPrograms session can be populated with the programs that should be started in combination with TWebServices.

Code Block
{
  "appSettings": {
    "RunPrograms": {
    }
  }
}

This file is located in the folder /Users/Public/Public Documents/<ProductName>/MachineSettings in Windows Computers, or similar path under MyDocuments for other operating systems.

Info

Typically this configuration is used in Linux and Docker deployments, as in Windows you can setup the Solution itself to start as a Windows Service.

The configuration page Runtime > Startup can setup a  Solution to run as service in Windows, or if the Designer is connected to a remote .NET 8 device, it adds a line in this configuration file, so the MultiPlatform solution will start on device power-on.



Preventing Ports Conflict

If you have error messages during the setup, or if you are not able to remotely connect with your server, you need to verify the ports in use in your computer, making sure no other application is also using the port 10108. For that, you can use the Command Prompt window to

Overview

The Embedded Web Server, TWebService, is automatically installed with the product.

The primary function of a web server is to store, process, and deliver web pages to clients. Communication between the client and server takes place using HTTP (or HTTPS).

The TWebService is simple solution, no configuration required, to enable the remote HTML5 and SmartClients displays when running your solution. The TWebService also enables execution of other Web Services, including the Solution Server service necessary to allow remote users to configure Solutions located in the server.

The product installation tries to setup TWebService on port 80 — or if fails, port 3100 — running as Windows Service. 

Info
titleTWebServer Installation

If the product Installation was successfulthere are no actions or any manual configuration required to do!

If both ports are already in use, the installation fails. In this case, you need to manually install TWebService in another port, or use the Microsoft IIS Web Server instead. The IIS setup is described in Installing on Microsoft IIS.

This document describes how to identify if a Port is being used, and how to manually change or execute the TWebService installation

Info
titleAbout Linux

TWebService is not used on Linux installations, as the SolutionServer.exe provides remote access to solution and the TServer.exe that runs the application is also a file server for the HTML5 clients. 

Verifying which Ports are in use

To find the processes using web services at port 80, at the DOS prompt, you should run:

  • netstat -aon

This will display all the ports in use. Look after the 0.0:80 or 8080 10108 string sequence on the Local Address column and get the PID (process identification).

  • tasklist

This will display all the process names and their identifications, so you can find which one is using the port 8010108.

If the application using Port 80/8080 10108 is an application you can stop it and use the standard Product installation; otherwise you should install the Web services need use the TWebServices in another port.

Installing using a custom

Custom Port Setup

This procedure describes how to install TWebService.exe to run in use mode, not as a Windows Service.To run the TWebService in another port, you need to do the following steps:

  • Uninstall the current TWebService from port 80, at the Administrator command prompt.
Code Block
C:\Program Files (x86)\...\<ProductName>, execute: InstallTWebService /uninstall /port:80
  • Install the service on the target port. For instance, 1234, using an Administrator command prompt
Code Block
InstallTWebService /port:1234

This uninstall and install setup procedures is executed only once. But, as we are not user Servicesthe call to TWebService.exe needs to be added to added Windows Startup folder with the new port.  

In order to update the port number on TWebService.exe shortcut at the Windows Startup folder, use the following steps:

  • On the Windows startup, modify the TWebService.exe shortcut by adding the parameter: /port:1234.
  • To create a shortcut for the TWebService using custom ports, you can go to the Product’sinstallation folder, right click on top of the TWebService, and select ”Sendtodesktopasa shortcut”, or you can search for the shortcut in the Windows Startup folder. Then, you should right click the shortcut to edit its properties and change the ”Target” to:

    .

    Step 1 - Access the directory: C:\Users\Public\Documents\FrameworX\MachineSettings\

    Step 2 - Edit the TWebServices.json file, by right clicking on it and selecting “Edit”in Notepad.Then, change the parameter “portnumber” by typing the desired port number:
    Image Added


    Step 3 - Save the file and open  the TWebServices.exe.

    Image Added


    Advanced Diagnostics

    In order to Check if TWebServices is running:

    Code Block
    "C:\Program Files (x86)\...\<ProductName>\TWebService.exe" /port:1234

    If you the port number is different than the default ones, 80 or 3100, you need to start using the new port number on client connection to that server. See the examples using new port number 1234

    Code Block
    http://127.0.0.1:1234/fs-8.1/TSmartClient.application
    http://127.0.0.1:1234/fs-8.1/html5/index.html

    TWebService as a Windows Service

    This procedure describes how to install TWebService as a Windows Service using a custom Port. 

    Stop the execution of the TWebService.exe, if that process is running. 

    Uninstall the current TWebService. At the Administrator command prompt execute:

    Code Block
    cd <Product Installation folder>
    InstallTWebService /uninstall /port:<portNumber>

    Install it again, using the Administrator command line below:

    Code Block
    cd <Product Installation folder>
    InstallTWebService /windowsservice /port:<portNumber>

    The service can be configured for a specific user account by accessing the TWebService service properties and setting the LogOn property to the desired account.

    Code Block
    The uninstall and install procedures are executed only once. The call to TWebService /port:1234 should be executed every time you login the computer
    
    The new port should be specified in the client URL configuration. 
    E.g.:
    http://127.0.0.1:1234/fs-8.1/TSmartClient.application -- For Port Number 1234 
    http://127.0.0.1:1234/fs-8.1/html5/index.html

    Define the Service Log On

    This procure will update the Service Log On using a network account

    • Open Windows Services and right-click TWebService to stop it.

    Right-click FactoryStudioTWebServer Service, then Stop.Image Removed

    • Once the service is stopped, open the Service Properties by right-clicking and selecting Properties.

    Right-click FactoryStudioTWebServer Service, then select PropertiesImage Removed

    • Click on Log On tab and enter the network account details the software platform service should use to run the application.

    Fill in the fields needed and click OK to finish.Image Removed

    • Click on OK and attempt to start the service.

    Right-click FactoryStudioTWebServer Service, then select Start.Image Removed

    • Check if the service was successfully started and its status is “Running”.
    Check if TWebServices is running

    1. Open Windows Services and verify that the “TWebServices-FrameworX Services“ was successfully created.

    2. Right-click the service and attempt to start it.

    3. Check if the service could be started successfully and its status is Running.

    Using HTTPS with TWebServices

    TWebServices accepts HTTPS/SSL connection with self-certificate, verify the following requirements before enabling that feature.

    1. It is necessary to install a certificate that must be created by customer. This certificate has the same characteristics as other certificates that are installed in IIS.

    2. Self certificates are accepted, but Web Browsers will warn that these certificates are invalid. It is strongly recommended to use from a certificate provider such as VeriSign.

    3. If anyone has any computer with a real certificate, it would be good to test for validation and finish the implementation.

    Steps to enable:

  • Call "TInstallTWebServices" with parameter "/uninstall" with the port number (optional, defaults are 80 and 3100).

  • Install your certificate.

  • Change settings of TWebServices.exe.config file. Find  "HTTPS/SSL" sections, uncomment them and configure the required entries.

  • Call again "TInstallTWebServices" with the port number (optional, defaults are 80 and 3100) to register new settings.



    In this section:

    Page Tree
    root@parent
    spacesV10