Client-Server Communication in DSPs

At runtime, dynamic server pages are split into a non-persistent server layer that generates HTML, CSS, and JavaScript, and a client layer that handles user input and synchronisation with the server layer. Communication between the client and server layers is asynchronous, via HTTP requests and responses over the internet.

Asynchronous makes parallel processing possible, providing a more responsive and dynamic user experience. Once the request has been sent, the sender does not wait for a response before proceeding to the next request. For example, an end user can change the value of an input field while waiting for another part of the data to be updated by the server.

The following illustration shows the basic communication flow in the HTTP request-response cycle of a Uniface web or mobile app that uses dynamic server pages.

Uniface HTTP Processing

How Uniface processes HTTP requests and responses.

  1. When the application is started, the client sends an HTTP request for the main DSP component to the server.
  2. The web server activates the WRD, which converts the HTTP request into a Uniface activation request, and dispatches it to the Uniface Server, via the Uniface Router.
  3. The Uniface Server activates the requested DSP, passing it the headers and data in the request.
  4. When the component is executed, it interprets the request, performs requested processing, and generates a response. For example, it can retrieve and store data in a database and generate HTML containing this data.
  5. The Uniface Server sends the response back to the WRD and removes the server-side DSP instance.

    The response includes the HTML and CSS required to render the layout and data, as well as a JavaScript-based runtime engine, which provides the mapping between the client and server sides of the component . )

  6. The WRD converts the Uniface Server response into an HTTP-compliant response, which is returned to the client by the web server.
  7. Subsequent communication between the client and server layers of the DSP is handled by Uniface's JavaScript runtime engine.

Related Topics