How do you want to intercept every request?
-
for example, you can use OnReadFromStream/OnWriteToStream events of Server component. here you can get client’s request and server’s response.
-
if you want just get information about client, you can use
OnGetDispatchInfo
event of _Impl. see code snippet in Receiving information about client on server-side topic -
another way - create descendant of TROInvoker and override
CustomHandleMessage
method.
old code:
initialization
fClassFactory := TROClassFactory.Create('MegaDemoService', Create_MegaDemoService, TMegaDemoService_Invoker);
new one:
type
TMyMegaDemoService_Invoker = class(TMegaDemoService_Invoker)
protected
function CustomHandleMessage(const aFactory: IROClassFactory;
const aMessage: IROMessage;
const aTransport: IROTransport;
out oResponseOptions: TROResponseOptions): boolean; override;
..
initialization
fClassFactory := TROClassFactory.Create('MegaDemoService', Create_MegaDemoService, TMyMegaDemoService_Invoker);
in TMyMegaDemoService_Invoker.CustomHandleMessage
you can allow/disallow execution of server’s method