Windev Magazine [WORKING - TRICKS]

PROCEDURE SendPendingMessages() LOOP FOR EACH Outbox_Table WHERE Status = "PENDING" // Prepare REST call to WebDev cloud server Request is httpRequest Request.URL = "https://cloud.myapp.com/api/v1/sync" Request.Method = httpPost Request.ContentType = "application/json" Request.Body = Outbox_Table.PAYLOAD Request.Execute()

// In the "Page header" (Server code) PROCEDURE ReceiveOrder(payload is string) // Validate JWT token (Security) IF Not ValidateToken(HeaderToJSON()) THEN RETURN 401 END // Decode JSON OrderInfo is JSONObject = JSONParse(payload) windev magazine

HAdd(Cloud_Order)

How to use HFSQL replication and WebDev services to keep your legacy desktop app in sync with a modern mobile portal. However, management now wants a mobile or web

[Your Name] Audience Level: Intermediate to Advanced Time to read: 10 minutes 1. The Problem: The Two-Speed IT Department Many of our readers manage warehouses, logistics, or medical systems where the core business runs on a WinDev Desktop application linked to an HFSQL Server (on-premise). However, management now wants a mobile or web portal (built in WebDev) hosted in the cloud. Only new/modified records travel over the wire

// In the WebDev project initialization (Server code) HDescribeReplication("CloudDB", "CUSTOMER", "Replication_ON_PREMISE") HReplicationCreate("CloudDB", "CUSTOMER", "Product_Table", "127.0.0.1", "MasterDB") HFSQL replication uses delta packets. It is 1,000x faster than CSV exports. Only new/modified records travel over the wire. 4. Step 2: The Real-Time Transaction Queue (The "Transactional" Lane) For high-write data (Orders, Inventory Movements), replication can cause conflicts. Use an Outbox pattern .

The challenge is not building the apps; it is . You cannot expose your on-premise HFSQL directly to the internet, and batch imports/exports are too slow for real-time inventory. 2. The Architecture: The "Reversé" Proxy Pattern Instead of the cloud pulling data from the premise (which requires opening firewall ports), we will use the premise pushing data to the cloud via secure REST APIs. We will also use HFSQL Native Replication for the read-only data.