RTC Forums
May 19, 2024, 09:30:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Getting RtcFunctionInfo from RtcClientModule.OnBeginRequest  (Read 3814 times)
Max Terentiev
RTC License
***
Posts: 49


« on: January 30, 2017, 09:35:08 AM »

Hi Danijel,

I need to log remote functions calls and also perform some special things (for example exclude some remote functions from logging) depends on their names.

It's possible to do it in centralized way, for example from RtcClientModule.OnBeginRequest ? Here I can get request's HTTP header but can't access body (it's json in my case). It's possible somehow ? It's will be very nice to access TRtcFunctionInfo currently processed by RtcClientModule in OnBeginRequest event. How to do it ?

Thanks !
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: January 30, 2017, 12:12:25 PM »

Please, download RTC SDK v7.71 (just released) and check the new "OnPrepareCall" event on the "TRtcClientModule" component. This event will be triggered after the "OnBeginRequest" event, for every remote call being prepared for sending through this component, before triggering the "PreparingCall" event on the "TRtcResult" component (assigned to the "Call" method to receive the Result from the Server).

It can be used to monitor, modify and/or skip remote calls before sending.

The Sender parameter (connection component) can be used to access Session, Request or Response information, but NOT to Read the content Body or to Write the content out directly to the connection component.

Data parameter will contain the remote call, Result parameter will be NIL.

Set "Data.isNull:=TRUE" in this event if you want to SKIP sending this remote call.
This will also SKIP triggering the "PreparingCall" event on the "TRtcResult" component.

Best Regards,
Danijel Tkalcec
Logged
Max Terentiev
RTC License
***
Posts: 49


« Reply #2 on: January 30, 2017, 02:29:36 PM »

Thank you very much !
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.