Interface update problem

Hi,
We use an extended UserInfo class in the LogIn service (CodeFirst Server).

  TOurUserInfo = class(UserInfo)
  private
    FClientGegevens: string;
    FControlePunten: string;
    FIsToken: boolean;
  protected
    procedure ReadComplex(aSerializer: TObject); override;
    procedure WriteComplex(aSerializer: TObject); override;
  published
    property ClientGegevens: string read FClientGegevens write FClientGegevens;
    property ControlePunten: string read FControlePunten write FControlePunten;
    property IsToken: boolean read FIsToken write FIsToken;
  end;

Recently we had to update the interface file (….Library_Intf)
Since then, during login on client side, the ReadComplex method throws exceptions (integer overflow error)
I compared the interface file, generated by an older version of Data Abstract, with the current one .
I noticed that the code for the original members of the UserInfo class is no longer present in the generated interface file. (Idem ditto for the WriteComplex method)

Original interface file :

procedure TOurUserInfo.ReadComplex(aSerializer: TObject);
var
  __Serializer: TROSerializer;
  l_Attributes: VariantArray;
  l_ClientGegevens: UnicodeString;
  l_ControlePunten: UnicodeString;
  l_IsToken: Boolean;
  l_Privileges: StringArray;
  l_SessionID: ROUTF8String;
  l_UserData: Binary;
  l_UserID: ROUTF8String;
begin
  __Serializer := TROSerializer(aSerializer);
  if __Serializer.RecordStrictOrder then begin
    inherited ReadComplex(aSerializer);
    l_ClientGegevens := Self.ClientGegevens;
    __Serializer.ReadUnicodeStringWithErrorHandling('ClientGegevens', l_ClientGegevens);
    Self.ClientGegevens := l_ClientGegevens;
    l_ControlePunten := Self.ControlePunten;
    __Serializer.ReadUnicodeStringWithErrorHandling('ControlePunten', l_ControlePunten);
    Self.ControlePunten := l_ControlePunten;
    l_IsToken := Self.IsToken;
    __Serializer.ReadEnumeratedWithErrorHandling('IsToken', System.TypeInfo(Boolean), l_IsToken);
    Self.IsToken := l_IsToken;
  end
  else begin
    l_Attributes := Self.int_Attributes;
    __Serializer.ReadArrayWithErrorHandling('Attributes', VariantArray, l_Attributes);
    if Self.int_Attributes <> l_Attributes then begin
      FreeOrDisposeOf(Self.int_Attributes);
    end;
    Self.Attributes := l_Attributes;
    l_ClientGegevens := Self.ClientGegevens;
    __Serializer.ReadUnicodeStringWithErrorHandling('ClientGegevens', l_ClientGegevens);
    Self.ClientGegevens := l_ClientGegevens;
    l_ControlePunten := Self.ControlePunten;
    __Serializer.ReadUnicodeStringWithErrorHandling('ControlePunten', l_ControlePunten);
    Self.ControlePunten := l_ControlePunten;
    l_IsToken := Self.IsToken;
    __Serializer.ReadEnumeratedWithErrorHandling('IsToken', System.TypeInfo(Boolean), l_IsToken);
    Self.IsToken := l_IsToken;
    l_Privileges := Self.int_Privileges;
    __Serializer.ReadArrayWithErrorHandling('Privileges', StringArray, l_Privileges);
    if Self.int_Privileges <> l_Privileges then begin
      FreeOrDisposeOf(Self.int_Privileges);
    end;
    Self.Privileges := l_Privileges;
    l_SessionID := Self.SessionID;
    __Serializer.ReadLegacyStringWithErrorHandling('SessionID', l_SessionID, [paAsUTF8String]);
    Self.SessionID := l_SessionID;
    l_UserData := Self.int_UserData;
    __Serializer.ReadBinaryWithErrorHandling('UserData', l_UserData);
    if Self.int_UserData <> l_UserData then begin
      FreeOrDisposeOf(Self.int_UserData);
    end;
    Self.UserData := l_UserData;
    l_UserID := Self.UserID;
    __Serializer.ReadLegacyStringWithErrorHandling('UserID', l_UserID, [paAsUTF8String]);
    Self.UserID := l_UserID;
  end;
end;

The new interface file:

procedure TOurUserInfo.ReadComplex(aSerializer: TObject);
var
  __Serializer: TROSerializer;
  l_ClientGegevens: UnicodeString;
  l_ControlePunten: UnicodeString;
  l_IsToken: Boolean;
begin
  __Serializer := TROSerializer(aSerializer);
  if __Serializer.RecordStrictOrder then begin
    l_ClientGegevens := Self.ClientGegevens;
    __Serializer.ReadUnicodeStringWithErrorHandling('ClientGegevens', l_ClientGegevens);
    Self.ClientGegevens := l_ClientGegevens;
    l_ControlePunten := Self.ControlePunten;
    __Serializer.ReadUnicodeStringWithErrorHandling('ControlePunten', l_ControlePunten);
    Self.ControlePunten := l_ControlePunten;
    l_IsToken := Self.IsToken;
    __Serializer.ReadEnumeratedWithErrorHandling('IsToken', System.TypeInfo(Boolean), l_IsToken);
    Self.IsToken := l_IsToken;
  end
  else begin
    l_ClientGegevens := Self.ClientGegevens;
    __Serializer.ReadUnicodeStringWithErrorHandling('ClientGegevens', l_ClientGegevens);
    Self.ClientGegevens := l_ClientGegevens;
    l_ControlePunten := Self.ControlePunten;
    __Serializer.ReadUnicodeStringWithErrorHandling('ControlePunten', l_ControlePunten);
    Self.ControlePunten := l_ControlePunten;
    l_IsToken := Self.IsToken;
    __Serializer.ReadEnumeratedWithErrorHandling('IsToken', System.TypeInfo(Boolean), l_IsToken);
    Self.IsToken := l_IsToken;
  end;
end;

Our current development environment :
Delphi 11.3
Remoting SDK & Data Abstract version 10.0.0.1559

Any idea ?

Hi,

Try to update DataAbstract4_Intf.pas as

class function TLibraryAttributes.RodlName: string;
begin
  result := '$(Data Abstract for Delphi)\Source\DataAbstract4.RODL'; //<<<< changed
  exit;
end;

after this rebuild server, launch it and update _Intf.
will it solve this case?

Hi Evgeny,

That’s it :slight_smile:
It’s OK now.

Thank you for the quick response !

Freddy