Is there any general way to capture and read the content of a communication message referenced by the IROMessage interface, without using a specific instance of the implementing object? I am specifically interested in the possibility of capturing the content of binary messages. Something like this:
> function TMyInvoker.HandleMessage(const aFactory: IROClassFactory;
> const aMessage: IROMessage; const aTransport: IROTransport;
> out oResponseOptions: TROResponseOptions): boolean;
> begin
// get message content as XML or JSON..
> var LContent:= aMessage.GetAsString;
> end;
Thank you for your reply, I probably wasn’t very clear. I know I can read the message content as a generic TStream, using the IROStreamAccess interface. My point is more whether it is possible to deserialize the content and convert it into a readable string, e.g. XML or JSON, in a general way, without knowing the structure and content of the message. I need this in order to log traffic on the server.
Maybe there is a procedure for general conversion of messages from one format to another, e.g. from binary TROBinMessage to TROJSONMessage…?