#1 2013-11-15 08:13:42

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

Rest server sample

Hi,

I have been reading the Synopse SAD 1.18.PDF but I found it too dense for my knowledge. Maybe I'm not following good practices or maybe this is not what I really need or I couldn't understand the samples so I'm going to explain what I need with an example:

- I need to create a web service wich will be accessed by Delphi and JavaScript clients.
- I'm not prepare to use the ORM so I preffer to continue using a TDataset descendant, in my case FIBPlus.
- I would like to get some data and use the mORMot inmemory dataset to show it on a DBGrid. Something like
localhost/rest/getcustomers
HEADERS
POSITIONINI = XXX
CANT = 20
and get the JSON of the customers table from position XXX and 20 rows.
Read that JSON into the memory table and show it on a DBGRID. Of course this would be on the client side.

I have been playing with websnap following the examples of Delphi 2010 Handbook so that is my background on webservices using Delphi.
Can you refer me to an example close to what I need?

Thanks in advance,

Fon

Offline

#2 2013-11-15 15:36:26

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

Re: Rest server sample

I suspect the easiest is to take a look at "method-based services" chapter in the SAD pdf.

And sample "06 - Remote JSON REST Service".

Offline

Board footer

Powered by FluxBB