Equivalent to Delphis GetDispatchInfo () on ROSDK.Net

net

(Jens) #1

How can I intercept the dispatch-info in .Net, to log the Client IP-Address or contents of the text-based messages (JSON,SOAP)?

Old Delphi code:

procedure TNewService.RORemoteDataModuleGetDispatchInfo(
  const aTransport: IROTransport; const aMessage: IROMessage);
var tcpinfo:IROTCPtransport;
begin
  if Supports(aTransport, IROTCPtransport, tcpinfo) then
  begin
    Session['ClientIp'] := tcpinfo.GetClientAddress;
    if aMessage is (IROJsonMessage) 
    (
         ....   // log the DataStream of aMessage
    );
  end;
end;

(antonk) #3

Hello

Implement the RemObjects.SDK.Server.IMessageAwareService interface service in your service like this:

public IMessage Message
{
  get
  {
    return null; // This is not used anyway
  }
  set
  {
    // Here value contains actual Message instance
    // this.ServerChannel contains channel info
  }
}

Regards