TWebSocketClient oddity receiving plain text

Hi. I have a Web Core app using TWebSocketClient to connect to a TTMSWebSocketServer in a Delphi server program. Each side sends plain text to each other.

I've done this before and haven't had any issues, but now when the web client receives a message it sees "[object Object]" instead of the actual message text. Messages the other way get through as expected.

At the server, the message is sent with:

WebSocketServer.BroadcastMessage('some message');

At the web client, the code is:

procedure TForm1.WebSocketClient1DataReceived(Sender: TObject; Origin: string;
Data: TJSObject);
s: String;
s := Data.toString;



Regardless of what text is sent, it always displays as "[object Object]".

I'm using Web Core V1.5.6.0 and Delphi Ent 10.2.3.

I've tested the server using an online websocket checker ( and that shows the text messages as expected, so my issue seems to be with the web app side.


So ... although I installed web core 1.5.6 for 10.2 (and 10.3 and 10.4), within 10.2 IDE Help --> About TMS Web Core is showing 1.3.8.

Also, the same web core app in 10.4 fails to build because the OnDataReceived event now has the received data in a TJSObjectRecord not TJSObject. Changing the code to do

s := SocketData.jsobject.toString;

now works fine.

So I have an odd situation where I've installed 1.5.6 for all 3 IDEs (10.2, 10.3, 10.4) but Delphi 10.2 reports TMS Web Core 1.38, 10.3 reports, and 10.4 reports

TMS web core was install from the subscription manager. I'll remove all copies then re-install.

So, n/m for now.


Sorted by uninstalling web core via Windows control panel, then reinstalling via subs manager, then changing the code to adopt the new definition for OnDataReceived.


1 Like