I want to call a service method which is defined in another service. For instance, I have one service definition unit (let’s call it unit interface_one.pas):
[ROService('interface_one')]
TTest1 = class(TRORemoteDataModule)
private
public
[ROServiceMethod]
procedure CallOtherMethod;
I want to call (inside CallOtherMethod) this service method defined in unit interface_two.pas:
[ROService('interface_two')]
TTest2 = class(TRORemoteDataModule)
private
public
[ROServiceMethod]
procedure DoSomething;
if you need session support, you can pass session id via IROObjectActivation interface:
t2 := TTest2.Create(nil);
(t2 as IROObjectActivation).OnActivate(guid, nil);
t2.DoSomething;
(t2 as IROObjectActivation).OnDeactivate(guid);
t2.Free;
You can review LocalServiceAccess_Acquire/LocalServiceAccess_Release methods for more details but these methods are suitable for RODL-based services when you have defined interfaces like