#1 2013-12-16 07:12:00

foncci
Member
Registered: 2013-11-15
Posts: 53

Some issues

Hi,

I have to say that after some help from a friend I'm taking off with mORMot and results are quite impressive but I still need some help with some issues.
I'm using the last Nightly Build.

- Returning a manually serialized JSON

function TServiceSQLExec.echonoparams: RawJSON;
begin
  Result := '{"PRUEBA NO PARAMS":100}';
end;

what I actually get is:

{
"result":{
"Result":{"PRUEBA NO PARAMS":100}
},
"id":2092
}

Why the framework adds two "Results" and "id":2092 and what does it means? How can I get only my original JSON {"PRUEBA NO PARAMS":100}?
- In case a function is defined parameterless, service return error "Parameters required", a workaround is to use "?[]"
http://localhost:888/rest/MySQLExec.echonoparams?[]
but it doesn't look any good in an URL. I'm consuming the services from a browser.
- Is it there any way to serialize a TDataSet descendent or import/export it directly to/from a TSQLTableJSON?
- For debugging purposes it should be nice to have named threads. I propose to use the classname + consecutive.
- I would like to "zip" and encrypt the JSONs, I know from Delphi-Client it is possible, how can I do that from Browser-Client using Content-Type: gzip?

Regards,

Al

Offline

#2 2013-12-16 14:15:49

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

Re: Some issues

Thanks for the feedback.

First of all, ensure you search in the SAD 1.18 pdf - see the download section of this site.
Most of your concern is already explained there.
Take a look also at the extract of this documentation in our blog : http://blog.synopse.info/post/2012/03/0 … on-details and related articles. But the SAD pdf is much more updated and accurate.

The ID is the session or thread ID, depending on how your service is registered.
You can use raw content using a specific record name (see the SAD pdf).

I never serialized TDataSet content, but it may be feasible.
There is no built-in method yet.

Threads are created in a thread pool, so naming threads do not have any benefit.

About compression, take a look a the forum.
http://synopse.info/forum/viewtopic.php?pid=6780#p6780

Offline

Board footer

Powered by FluxBB