Pass a RemObjects TROComplexType object from Delphi to C# modul via hydra interface

How can I pass a TROComplexType in a simple und fast way from my Delphi Server to a hydra c# modul / plugin method? This without using a RemObject API call via message. One solutions could be using TROPostMessageSerializer to serialize my RO object to a string and pass this string via hydra interface. Or is there a cleaner way?

Hello,

It depends on what you trying to achieve, if you have a custom type derived from TROCompleType and you need to expose its members to a .net module you can create a custom interface and a wrapper class and then pass them to a .net side, here is a link that shows how to do that - http://wiki.remobjects.com/wiki/How_to_pass_objects And general informtation about custom interfaces - http://wiki.remobjects.com/wiki/Passing_interfaces_between_Host_and_Plugins

But if you need an ability to serialize/deserialize this objects it may be better to use RO Api.

Hi there
I now this thread is a little aged alreay, yet I am facing exactly the same problem.
We have many Objects defined in the rodl. For example a TPerson and a TPersonList.
What I want to do is to defined an interface method in c# like this:

[Guid(“3C88DA36-89F2-4496-B03F-1F4A5E1D4C51”)]
public interface ICrmService : IHYCrossPlatformInterface {
String ComposeSerialLetter (String TemplateStream, TPerson[] Personlist);
}

Now I want to call this method from within the delphi application server in some reasonable way!

Please tell me that there is no need for creating some weird wrappers or additional interfaces in order to perform such a basic operation or that there is some need of manually serializeing / deserializeing those objects! :wink:

Many thanks

Hello

“Weird wrappers” are needed to help one platform to access entities allocated by other platform. Also in general they are used to define fields of the object that is passed between the platforms. Otherwise how, say, C# compiler would know the data structure of the object that will be passed from a Delphi host?

In your case you could take advantage of the fact that your structures are already defined in the platform-independent language (aka RODL). You could generate _Inft code on both platforms and this code will contain both structure definitions and their serialization/deserialization methods.
So it is possible to leverage these definitions, by serializing a custom object (or an array of them) on one side, pass it via single method like (C# notation)

Byte[] Execute(String methodName, Byte[] parameters);

You’ll still need one (just one) wrapper interface, code to serialize/deserialize data and an ‘invoker’ on the .NET side to deserialize data and call the required method.

Serializer code sample in C# can be found at “…\RemObjects SDK for .NET\Source\RemObjects.SDK.Server\SessionManagement\ComplexTypeSerializer.cs”

Regards