RO server connecting to itself with RequiresSession=True

Should it be possible for a RO server to use its own services via TROHydraLocalService when a login is required?

I have an IRobotService2 (RequiresSession=true) and a IRobotLoginService (RequiresSession=false)

My server calls
if supports (RobotLoginService, IRobotLoginService, intf) then
sessionid:=intf.Login(‘server’,’’);
and then
if supports (_RobotService, IRobotService2, intf) then
intf.InitRobot(False);

I get a SessionNotFound exception on the second call
It also seems that the Session.SessionID of the Login function contains {00000000-0000-0000-0000-000000000000}

This probably needs to be a nonzero GUID?

each ROService supports

  { IROObjectActivation }
  IROObjectActivation = interface
  ['{071ECDF1-A4B0-4333-93B4-EE1B8609FF80}']
    procedure OnActivate(aClientID: TGUID; const aMessage: IROMessage);
    procedure OnDeactivate(aClientID: TGUID);
  end;

so you can call OnActivate method before actual method call, like:

intf.OnActivate(myguid, nil);
try
  intf.InitRobot(False);
  // do something
finally
  intf.OnDeactivate(myguid);
end;

I do not have these functions
IRobotService2_Async = interface(IROAsyncInterface)
No such functions in IROAsyncInterface

or should I queryinterface for IROObjectActivation ?

ofc, Async interfaces are designed for client-side so they have no such functionality.
why you can’t put code into background thread and use usual service instead of async one?

  1. my IRobotService2 inherits from IROService which also does not have onActivate
    How do I change my ITF so it has IROObjectActivation as a parent?

  2. I also tried your
    myservice := TNewService.Create(nil);
    try
    myservice.mymethod;
    approach but this still gives a session error.
    EROException : The session has not been initizalized.
    Suggestons here?

can you create a simple testcase, pls?
it will allow to me to give to you proper workaround
you can send it to support@