You are not logged in.
Pages: 1
type
TAgentItem = class(TCollectionItem)
property Queues: TRawByteStringDynArray read FQueues write FQueues;
end;
IAgents = interface(IInvokable)
['{69D97B11-3143-471F-B380-F706A3B6F6CB}']
procedure GetLogged(out agentCollection: TAgentsCollection);
procedure Logout(const AgentID: integer);
end;
implementation
var
agent: TAgent;
qList: TRawByteStringDynArray;
begin
SetLength(qList, agent.QueueCount);
for var j := 0 to agent.QueueCount - 1 do
qList[j] := StringToUTF8(agent.Queue[j].Name);
Queues := qList;
end;
the response for that query looks like that:
{"agentCollection":[{"ID":2,"Ident":"super01","Name":"super01 super01","Status":2,"UserStatusID":0,"PhoneRegistered":false,"IPAddress":"","Queues":["VGVzdA==","VFNfVGVtYXQx"]}]}
the Queue seems to be base64 encoded. What I'm doing wrong?
Offline
This is as expected and documented.
https://synopse.info/files/html/Synopse … l#TITL_154
RawByteString are serialized as Base-64 encoded blobs. They are meant to store any kind of content, maybe some binary including zeros. It is unsafe to store zeros in JSON, so we use Base-64 encoding for RawByteString.
If you want strings, use TRawUTF8DynArray. But they should not contain any #0 byte/character.
Offline
Pages: 1