I have advanced something in my .NET client, but now I’m facing the issue described: the strings arrive into the Server (which is developed in C++Builder) with half the length.
In my service all strings are defined as WideStrings, and the C++Builder client works fine. With the .NET client I see all the string parameters as type string, and the serialization code appears to be correct: it calls “WriteWideString”.
I haven’t tried changing the service to use UTF8Strings, but would certainly prefer not to change it if it can be avoided.
Is there something special to take into account when mixing .NET clients and VCL servers?
I found the problem. It has to do with the TypeInfo helpers created for C++Builder compatibility. For WideString parameters I was using UnicodeString, but it should be WideString.
I haven’t been able to download the latest beta and see how, if they were indeed changed, the TypeInfo helper classes were implemented. But if you used the code I sent it should be checked that the TypeInfo for WideStrings do map to WideStrings and not UnicodeStrings. (although I had the idea that WideString was just an alias for UnicodeString, and that’s why I set it that way originally). I believe the Issue number you used for this was 70830.
Apparently there are still some issues with this, as now the parameters get correctly into the server, but the returned values have some garbage after the string ends, say, where it should say “Magia 101” it says: “Magia 101䱎敽ᔀ蠀” The extra characters are not correct (nor set in the Server). This still seems to be a problem with the amount of data returned/expected, but I don’t really know where else to search for.
For this to fail you need to create a C++Builder server and a .NET client. Having both in the same platform works fine here too. This works even with the TypeInfo incorrectly set to UnicodeString, as it was in my original code.
I will try anyway to create a test case, but you should be able to see the problem invoking that service from a .NET client.
Thanks
Edit: re-reading your post, you already tried with a .NET Client? That’s the ROD/RON client?
I was thinking: I’m using Runtime packages and Dynamic RTL on the Server, and AES encryption, bin Message and a SuperTCP transport. Don’t know if it changes anything, but that’s my setup.
The problem seems to be only with structs. “Simple” params work fine, but when you send/return a struct, or an array of said structs, then the problem appears.
This only happens, at least so it seems, with WideStrings.
I’m polishing the test case to send it, but you should be able to reproduce it adding a struct to your library and later using it.