Question : Problems with protocol buffers

I am using google's protocal buffers to "communicate" between a C#-application and a java-application. The communication goes through a message server. It works just fine when I send strings, ints and simpler types. My problem is that the C#-application sends a DateTime-object. Is it possible for me to get that object into Java somehow?

In the .proto-file I can only use "simple" types like:
required string name = 1;
optional int32 nr = 2;

I can't use for example( or can I ? )
required GregorianCalendar gc = 3;

I don't really understand how I can get data that isn't of simple type into the javacode. Is that even possible? I mean a DateTime-object in C#, can that even be replicated in java-code? I have no idea of how that class is represented internally so to speak. I can get the byte-array into the java code but what do I do with that? A GregorianCalendar in java seems to have similar setup as the DateTime in C# but can you go from one to the other so to speak.

Hope you understand what I mean.

Answer : Problems with protocol buffers

>>So I guess you cant just exchange objects in that sense between different languages, even with the helpof protocol buffers.

No, not without them being binarily portable. You could push it over the wire with C# serialization, but java would have to rely on raw reading to do anything with it
Random Solutions  
programming4us programming4us