Commit f46aa96a by Michael Brachmann

debugging websocket

parent 7cb87811
...@@ -74,8 +74,6 @@ begin ...@@ -74,8 +74,6 @@ begin
Url := Url + '/'; Url := Url + '/';
Url := Url + SERVER_PATH_SEGMENT; Url := Url + SERVER_PATH_SEGMENT;
XDataServer1.BaseUrl := Url; XDataServer1.BaseUrl := Url;
XDataServer1.ModelName := '';
Logger.Log(1, 'StartWsServer: ModelName cleared to empty');
XDataServer1.ModelName := AModelName; XDataServer1.ModelName := AModelName;
Logger.Log(1, 'StartWsServer: ModelName set to [' + XDataServer1.ModelName + ']'); Logger.Log(1, 'StartWsServer: ModelName set to [' + XDataServer1.ModelName + ']');
SparkleHttpSysDispatcher3.Start; SparkleHttpSysDispatcher3.Start;
......
...@@ -3,7 +3,8 @@ unit Ws.Service; ...@@ -3,7 +3,8 @@ unit Ws.Service;
interface interface
uses uses
XData.Service.Common; XData.Service.Common,
System.JSON;
const const
WS_MODEL = 'Ws'; WS_MODEL = 'Ws';
...@@ -12,7 +13,7 @@ type ...@@ -12,7 +13,7 @@ type
[ServiceContract, Model(WS_MODEL)] [ServiceContract, Model(WS_MODEL)]
IWebSocketService = interface(IInvokable) IWebSocketService = interface(IInvokable)
['{673FE678-D9EF-468D-89CB-CEF26E8758BC}'] ['{673FE678-D9EF-468D-89CB-CEF26E8758BC}']
[HttpGet] function WebSockerConnectionHandler: string; [HttpGet] function WebSockerConnectionHandler: TJSONObject;
end; end;
implementation implementation
......
...@@ -21,7 +21,7 @@ type ...@@ -21,7 +21,7 @@ type
[ServiceImplementation] [ServiceImplementation]
TWebSocketService = class(TInterfacedObject, IWebSocketService) TWebSocketService = class(TInterfacedObject, IWebSocketService)
public public
function WebSockerConnectionHandler: string; function WebSockerConnectionHandler: TJSONObject;
private private
function Health: string; function Health: string;
procedure ProcessJsonMessage(const AMsg: string); procedure ProcessJsonMessage(const AMsg: string);
...@@ -31,7 +31,7 @@ implementation ...@@ -31,7 +31,7 @@ implementation
{ TWebSocketService } { TWebSocketService }
function TWebSocketService.WebSockerConnectionHandler: string; function TWebSocketService.WebSockerConnectionHandler: TJSONObject;
var var
Upgrader: IWebSocketUpgrader; Upgrader: IWebSocketUpgrader;
WebSocket: IWebSocket; WebSocket: IWebSocket;
...@@ -39,7 +39,7 @@ var ...@@ -39,7 +39,7 @@ var
Msg: IWebSocketMessage; Msg: IWebSocketMessage;
MsgStr: string; MsgStr: string;
begin begin
Result := ''; Result := nil;
Logger.Log(1, 'websocket begin-------'); Logger.Log(1, 'websocket begin-------');
Upgrader := THttpServerContext.Current.Item<IWebSocketUpgrader>; Upgrader := THttpServerContext.Current.Item<IWebSocketUpgrader>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment