this is as expected. TROHttpApiResult is a special type that can be used only as a Result.
when server detects this type, actual method’s result will be replaced with this type.
by other words, it will works as
function TAllTableService.getuser(const ENTITY_ID_PK, USER_ID_PK: UnicodeString):Binary;
begin
Result := TROHttpApiResult.Create(HTTP_200_code, id_ContentType_application_json_charset_utf8,'',false);
....
end;
If I change like this , I can get the correct data member. However, The result dataformat for databinary, it is not json format, it is bin format as below picture
you can try to add your extra data like CallStatus and MsgInfo to Json struct that is returned by your stream.
what I mean:
function TAllTableService.getuser(const ENTITY_ID_PK, USER_ID_PK: UnicodeString):Binary;
begin
Result := TROHttpApiResult.Create(HTTP_200_code, id_ContentType_application_json_charset_utf8,'',false);
....
sjoson.Initialize(Result.DataBinary,aiwrite);
try
sjoson.WriteDataset(srcData, [ woRows], -1);
sjoson.WriteDataset(umData, [ woRows], -1);
finally
sjoson.Finalize;
end;
....
// read data back from stream with `JSON_ParseStream` and add `CallStatus` and `MsgInfo` as a properties.
// you may need to put existing dataset to a level below
// after adding `CallStatus` and `MsgInfo`, you need to write TROJSONValue back to stream.
end;