#1 Yesterday 09:06:34

anouri
Member
Registered: 2024-02-11
Posts: 123

ResultAsJsonObjectWithoutResult Does not affect

Hi every one.

  //var LItemService := aPassakServer.ServiceRegister(TItemService, [TypeInfo(IItemService)], sicPerSession, '4');
  var LItemService := aPassakServer.ServiceDefine(TItemService, [IItemService], sicPerSession, '4');
  LItemService.ResultAsJsonObjectWithoutResult := True;
  LItemService.ByPassAuthentication := False; //We can bypass authentication

when I cnahge ServiceRegister to ServiceDefine. ResultAsJsonObjectWithoutResult  does not affect and result is:

{
    "result": {
        "Result": [
            {
                "cust_code": "0001",
                "type": "domestic"
             }
     }
}

expected result is:
{
   "Result": [
       {
           "cust_code": "0001",
           "type": "domestic"
        }
}

Offline

#2 Yesterday 11:04:49

anouri
Member
Registered: 2024-02-11
Posts: 123

Re: ResultAsJsonObjectWithoutResult Does not affect

I find the problem.
with sicShared it is ok.
sicPerSession produce wrong result.


My question is, what do we need this json model for?
{"result":{"Result":[{"cust_code":"0001",type":"domestic"}}}}
What is the need for two result statements in json? Maybe I don't know the reason for this.

AB

Last edited by anouri (Yesterday 11:10:13)

Offline

#3 Yesterday 16:09:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,246
Website

Re: ResultAsJsonObjectWithoutResult Does not affect

This is by design, because sicPerSession requires a session number, which is transmitted back to the client as documented.

The mORMot 1 documentation still applies here.

Offline

#4 Today 13:38:32

anouri
Member
Registered: 2024-02-11
Posts: 123

Re: ResultAsJsonObjectWithoutResult Does not affect

Thank you

Offline

Board footer

Powered by FluxBB