#1 mORMot 1 » join SQL Fail » 2022-10-17 15:42:52

jars
Replies: 1

I would like to know why this simple join fails

SELECT a.PRODUCTTYPE, b.PRODUCTTYPE, a.REFERENCE, a.INVDATE, a.SECTOR,
FROM TABLEREF a JOIN TABLEREF b ON b.REFERENCE = a.REFERENCE
WHERE a.INVDATE = '27.06.2022' AND a.SECTOR = '7'
ORDER BY a.REFERENCE

Thanks in advance

#2 Re: mORMot 1 » TWebSocket Server, exchanging data with each connection not broadcast » 2022-07-22 16:21:15

ab, Could you give me an idea of how to deal with what you say about interface-based services over Websockets?
Thanks in advance.

#4 mORMot 1 » TWebSocket Server, exchanging data with each connection not broadcast » 2022-07-01 18:27:12

jars
Replies: 4

Hello, I have inherited an app that uses "TWebSocketServer", it receives and sends data to all connected clients but now I need to be able to identify each client and, depending on the case, send data only to one of them and not to all of them. Is there an example to do this?
Thanks in advance.

#5 mORMot 1 » Need help to extract message from json » 2018-07-05 14:43:16

jars
Replies: 1

Hi,
the same service can return the error message in 2 different ways, one of them is an array. How can you distinguish and display the "errorText" message of each one.

a) '{"errorCode": 400, "errorText": "There are ongoing communications}}'
b) '{"errorCode": 400, "errorText": "[{\" ACTIVITY_GROUP \ ": \" A \ ", \" MODEL \ ": \" HELLO \ ", \" STATUS \ ": 0}, \ r \ n {\ "ACTIVITY_GROUP \": \ "B \", \ "MODEL \": \ "SALE \", \ "STATUS \": 0}] \ n "} '


Thanks in advance.

#6 Re: mORMot 1 » Lost some bytes sending with websockets » 2016-10-24 14:46:36

I can't keep it without compression because the json size is about 150k.
Is there another way to send this binary data?
I only need to send this data from server to clients.

#7 Re: mORMot 1 » Lost some bytes sending with websockets » 2016-10-24 13:58:55

Why do you want to reinvent the wheel?

Because I don't know which programming language will use on client-side

#9 mORMot 1 » Lost some bytes sending with websockets » 2016-10-24 13:16:57

jars
Replies: 7

Hi,
Modifying the Project31ChatServer example, I compress some json records with Zlib for compatibility and then call "NotifyBlaBla(pseudo,msg)" where msg is the compressed json.
Once compressed I take volume size to compare with the size received.
What happens is that the client receive fewer bytes than the server sends.
I have no idea how to solve it or because it happens.
Thanks in advance for any help.

#10 Re: mORMot 1 » How send a asynchronous message from server with WebSocket » 2016-10-14 17:16:53

Hi Turrican,
How can I save some data from each client session?

#11 Re: mORMot 1 » How send a asynchronous message from server with WebSocket » 2016-10-14 11:48:42

Thanks Turrican.
What I need is to identify each client to send several packets to one and others times send the some packets to all clients.

#12 mORMot 1 » How send a asynchronous message from server with WebSocket » 2016-10-13 19:53:31

jars
Replies: 4

Hi guys.
Using the websocket example (Project31ChatServer and Project31ChatClient) I wish I could send asynchronous messages from the server side to each cliente subscripted to the server.
Is there some example to do that?
Thanks in advance.

#13 Re: mORMot 1 » Is there a way to serialize static arrays » 2016-10-11 11:59:22

Thanks Ab but can't understand. Have you an example?

#14 mORMot 1 » Is there a way to serialize static arrays » 2016-10-07 16:35:44

jars
Replies: 3

I need to convert to JSON this static arrays and  don't known how.

type
  TCCConfig = packed record
    Version: string[10];
    DNDReasons: array[1..15] of string[15];
  end;

const
  __TCCConfig = 'Version string[10]  DNDReason array[1..15] of string[15]';
....

// then use move to fill this record with lData stream.
var
  CCConfig: TCCConfig;
  CurOff: Integer;
begin
  TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TCCConfig),            <-------------  ERROR
  __TMCCConfig).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];

   CurOff := 1;
  system.move(lData[CurOff], CCConfig, sizeof(CCConfig));

#15 mORMot 1 » How can I define this Record for serialize » 2016-10-06 21:16:04

jars
Replies: 0

Hi, I need dim this strings with this values because I receive an stream from an app server and I use Move to populate this record.

  TCCConfig = packed record
    Version        : string[10];
    DNDReasons : array[1..15] of string[15];
  end;
....

  system.move(lData[CurOff], CCConfig, sizeof(CCConfig));

But I must declare so:

type
  TCCConfig = packed record
    Version        : string;
    DNDReasons : array of string;
  end;

const
  __TCCConfig = 'Version string DNDReasons array of string';

How can I deal with this?
Thanks in advance.

#17 Re: mORMot 1 » Help with serialization a record with set of enumerated » 2016-10-05 20:11:28

Thanks Ab.
With this code fire the error: TJSONCustomParsers.Search(kind=6) not DynArray or Record.

type
  TPosFlags = set of TPosFlag;
const
  __TPosFlags = '(pfInService, pfSupervisorHelp, pfReadyForCalls, pfMakingCall, '+
                'pfMakingCall2, pfReadyForChats, pfACDCall, pfACDChat, pfEnteringDigits)';

type
  TPosData = packed record
    PosNumber: Word;
    UserId: Word;
    PosFlags: TPosFlags;
  end;
  TACDPositions = array of TPosData;
const
  __TPosData = 'PosNumber Word UserId Word PosFlags TPosFlag'
               

    TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TPosFlags),
 __TPosFlags).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];

#18 Re: mORMot 1 » Help with serialization a record with set of enumerated » 2016-10-05 18:43:13

Hi Turrican.
I want pass to JSon.

    TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TPosData),
  __TPosData).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];

#19 mORMot 1 » Help with serialization a record with set of enumerated » 2016-10-05 16:45:29

jars
Replies: 6

Hi,
I'm developing with Delphi 7 and I don't known how define the constant for this record. Can you help me?

type
  TPosFlag = (pfInService, pfSupervisorHelp, pfReadyForCalls, pfMakingCall,
    pfMakingCall2, pfReadyForChats, pfACDCall, pfACDChat, pfEnteringDigits);

  TPosData = packed record
    PosNumber: Word;                 
    UserId: Word;                    
    PosFlags: set of TPosFlag;
  end;

const
  __TPosData = 'PosNumber Word UserId Word PosFlags set of TPosFlag';

Thanks in advance.

#20 Re: Delphi » How can I Encrypt and Decrypt a TMemoryStream with AES » 2016-09-13 12:01:08

Hi AB.
I need any encryption that is standard.
I'm using ZCompressStream (s, s1, zcMax) from ZLib;
On the client side have´t Mormot, so I need something as standard as possible.
I try to use Mormot because I have recommended it.
I just need some example of use.
Thank you.

#21 Delphi » How can I Encrypt and Decrypt a TMemoryStream with AES » 2016-09-12 19:51:50

jars
Replies: 3

Hi guys,
I'm new in mormot and need to compress a TMemoryStream with ZLib and then encrypt with AES before send thru TCP.
An external application then must decrypt and decompress this Stream.
Can anybody help me.
Thanks in advance.

#22 mORMot 1 » Retrieve data from a json multi array » 2015-06-03 17:44:23

jars
Replies: 1

Hi guys.
I need to show data from a received json with nested arrays and I have no idea how to do that, this is an json example:
Thanks in advance for any help.

[
    {
      "AgentInfo": {
        "ID": 5,
        "Type": 2,
        "UserName": "agente2",
        "FirstName": "Ariel",
        "LastName": "Ortego",
        "Email": "",
        "Settings": {
          "TecnoVozID": "5"
        }
      },
      "CurrentWork": {
        "MessageStats": {
          "AssignedMessages": 0,
          "RepliedMessages": 0,
          "DiscardedMessages": 0,
          "ReturnedToQueueMessages": 0,
          "UnassignedMessages": 0
        },
        "TimeStats": {
          "TotalAuxTime": 0,
          "AuxTime": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "AvailTime": 0,
          "WorkingTime": 0,
          "UnreadTime": 0
        }
      },
      "DayWork": {
        "MessageStats": {
          "AssignedMessages": 0,
          "RepliedMessages": 0,
          "DiscardedMessages": 0,
          "ReturnedToQueueMessages": 0,
          "UnassignedMessages": 0
        },
        "TimeStats": {
          "TotalAuxTime": 0,
          "AuxTime": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "AvailTime": 0,
          "WorkingTime": 0,
          "UnreadTime": 0
        }
      }
    }
]

#23 Re: mORMot 1 » How make Post to a Web Services that response with http code and Json » 2015-05-21 14:35:32

Many thanks for your kuicly response, it´s all i need for now.

#24 Re: mORMot 1 » How make Post to a Web Services that response with http code and Json » 2015-05-21 14:24:12

Thanks for the example, this is what I need.
This post has a response with a json object, how can I get this response?
Sorry I'd never worked with web services.

#25 mORMot 1 » How make Post to a Web Services that response with http code and Json » 2015-05-20 15:39:26

jars
Replies: 8

Hi, guys.
I´m developing with Delphi 7 and need to connect to a web services and make an http post with some parameters.
Can showme some example of use?
Thanks in advance

#27 Re: mORMot 1 » How get Json and populate a grid » 2015-05-18 20:51:04

Still no made this but i want to known how populate a grid via ClientDataset or DataSet from json

#28 mORMot 1 » How get Json and populate a grid » 2015-05-15 20:18:50

jars
Replies: 4

Hi, I´m new with Mormot.
I whish get a Json via WebService and show a grid that must refresh each 5 seconds.
How can do that?
Thanks in advance.

Board footer

Powered by FluxBB