Problem with order of fields in serialization of complex object in Delphi vs .NET

Hi,

I’m having problems with the interfaces generated for Delphi vs the one generated for C#, for a complex object. The order of fields is not correct. In the Delphi _Intf I get this:

l_User_GUID := Self.User_GUID;
__Serializer.WriteUnicodeString('User_GUID', l_User_GUID);
l_UserExists := Self.UserExists;
__Serializer.WriteEnumerated('UserExists', System.TypeInfo(Boolean), l_UserExists);
l_Username := Self.Username;
__Serializer.WriteUnicodeString('Username', l_Username);

But in the C# interface I get this:

public override void ReadComplex(RemObjects.SDK.Serializer serializer) {
    if (serializer.RecordStrictOrder) {
				...
    }
    else {
        ...
        UserExists = serializer.ReadBoolean("UserExists");
        Username = serializer.ReadWideString("Username");
        User_GUID = serializer.ReadWideString("User_GUID");
    }
}

It seems the underscore in the User_GUID field is sorted differently in the C# version than in the Delphi version. So I get an error when the C# client connects to the Delphi Server. I tried generating the C# interface using the service builder or importing it by connecting to the server.

If I change the order of fields in the (de)serialization of the object in the C# interface, the C# client can then work without problems with the Delphi Server.

Using RO/DA 9.0.97.1245 and Delphi 10.1 Berlin/VS 2015.

Thanks,
Arturo.

can you check this issue with 9.1.99.1273 ? we have already fixed similar issue long time ago

Hi, Evgeny,

I don’t have access to 9.1.99. Perhaps you can check it on your side? I’m attaching a small test case RODL which displays the problem described when the code is generated using the Service Builder in 9.0.97.

Thanks,
Arturo.

TestCase.RODL (726 Bytes)

_intf was generated as

procedure TFpMembershipUserInfo.WriteComplex(aSerializer: TObject);
var
  __Serializer: TROSerializer;
  l_UserExists: Boolean;
  l_Username: UnicodeString;
  l_User_GUID: UnicodeString;
begin
  __Serializer := TROSerializer(aSerializer);
  if __Serializer.RecordStrictOrder then begin
    __Serializer.ChangeClass(TFpMembershipUserInfo);
    l_User_GUID := Self.User_GUID;
    __Serializer.WriteUnicodeString('User_GUID', l_User_GUID);
    l_Username := Self.Username;
    __Serializer.WriteUnicodeString('Username', l_Username);
    l_UserExists := Self.UserExists;
    __Serializer.WriteEnumerated('UserExists', System.TypeInfo(Boolean), l_UserExists);
  end
  else begin
    l_UserExists := Self.UserExists;
    __Serializer.WriteEnumerated('UserExists', System.TypeInfo(Boolean), l_UserExists);
    l_Username := Self.Username;
    __Serializer.WriteUnicodeString('Username', l_Username);
    l_User_GUID := Self.User_GUID;
    __Serializer.WriteUnicodeString('User_GUID', l_User_GUID);
  end;
end;

Ok, perfect. I’ll start planning the upgrade to version 9.1.99.

Thanks,
Arturo.

Note: we just released 9.2.101.1295