Need to process all strings that are passed to server

I have a server application written in Delphi(Berlin) which uses RemObjects in order to communicate with clients. What I need to do is to have a generic solution to trim all the strings before they hit the endpoints from the server. I’m receiving on the server side TRoComplex descendants and TRoArray descendants. Looking at the RO source code I believe that

procedure TRORTTIInvoker.RTTIInvoke(const __Instance: IInterface;
const __Message: IROMessage; const __Transport: IROTransport;
out __oResponseOptions: TROResponseOptions);

is the proper place to try to accomplish what I want. But there TValues are added to a TList casted to TObject, and trying to parse the properties with RTTI is not solving the issue I have. How can I solve this?

Thanks,
RBA

Hi,

what message type you are using?
you can create an descendant of message & serializer and trim all strings in serializer method.

if you are using BinMessage, you can create TMyBinMessage and TMyStreamSerializer.
in new classes, you should override

  • TROBinMessage.CreateSerializer
  • TROStreamSerializer.WriteUnicodeString
  • TROStreamSerializer.WriteLegacyString