#1 2014-11-22 16:37:10

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Interfaced Base Service Question

Hi AB,

now i think i have read the complete Manual and Found 2 basic Examples for Interfaced based Services

ICalculator and IRemoteSQL

Both are nice examples for the Interfacs itself but what I'm missing is an example how the Interface class (here TServiceRemoteSQL) can access the aServer where  it is registerd to.

    aServer := TSQLRestServerFullMemory.Create(aModel,'users.json',false,true);
    try
      // register our IRemoteSQL service on the server side
      aServer.ServiceRegister(TServiceRemoteSQL,[TypeInfo(IRemoteSQL)],sicShared)

I want to create a little Interface function which selects and creates and deletes some records in the Model / Database of aServer.

How can i get easy access to aServer in TServiceRemoteSQL.


Rad Studio 12.1 Santorini

Offline

#2 2014-11-22 17:18:57

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: Interfaced Base Service Question

I testet a little bit and found that

ServiceContext.Factory.RestServer

could give me access to a TRestSQL which seems to contain my tables.


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB