#1 2020-11-04 22:22:07

radexpol
Member
From: Poland, Krk
Registered: 2019-11-29
Posts: 116

Named Pipes ResultAsJSONObjectWithoutResult

I'm hosting the SOA interfaces through the http and named pipes.

  Server := TSQLRestServerFullMemory.CreateWithOwnModel([], false, 'api');
  Server.CreateMissingTables;
  with Server.ServiceDefine(TTest,[ITest]) do
  begin
     ResultAsJSONObjectWithoutResult := True;
  end;

  Server.ExportServerNamedPipe('Test');
  HttpServer := TSQLHttpServer.Create('2080',[Server],'+',{$IFDEF DEBUG}useHttpSocket{$ELSE}HTTP_DEFAULT_MODE{$ENDIF}, 32, secNone, 'api');

http requests works fine, but the named pipes raises an error when I defined ResultAsJSONObjectWithoutResult := True;

error: Project Project3.exe raised exception class EInterfaceFactoryException with message 'TInterfacedObjectFakeClient.FakeCall(ITest.Test) failed: 'Invalid returned JSON content: expects {result:...}, got {}''.

Offline

#2 2020-11-05 10:03:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Named Pipes ResultAsJSONObjectWithoutResult

Did you use the proper settings on client side?

Offline

#3 2020-11-05 10:24:26

radexpol
Member
From: Poland, Krk
Registered: 2019-11-29
Posts: 116

Re: Named Pipes ResultAsJSONObjectWithoutResult

Yeah, you're right.

c := Client.ServiceDefine(ITest,sicSingle);
c.ResultAsJSONObjectWithoutResult := True;

Last edited by radexpol (2020-11-05 10:24:50)

Offline

Board footer

Powered by FluxBB