Davy Landman
Davy Landman

Reputation: 15438

How could I create a cross platform interprocess communication between .NET and Java?

I want to develop a certain plugin/extension, which needs to run in eclipse and has to integrate with another (java) plugin, but it has to collect data from .NET assemblies (using mono's cecil).

So my question is how should I create this relation between the Java code and the .NET? I know that I could use mono to run the .net application on for instance Linux, but I have 2 problems, I would like that the Java plugin starts the .NET application, and the second problem how to let the Java plugin make certain calls to the .NET application.

For this communication between these two applications, I would like to be platform independent so that the same binaries could run in both Windows, OSX and Linux. Another perhaps important fact is that the results of the calls could contain pretty big collection of objects.

Or perhaps it would be better/possible to host a .NET assembly inside of java and call it directly?

Update: I think an ideal answer would solve the following questions:

Upvotes: 4

Views: 1804

Answers (2)

jgauffin
jgauffin

Reputation: 101192

Communication between applications.

How to let a java application communicate with a .net application

Transportation

How to transport information between java and .net applications.

  • Sockets - connections can be left open and both sides can send stuff (= act as client)
  • WebServices - no connections are kept open, event handling will not work very well

Serialization

How to convert objects into something that can easily be transported.

  • Plain XML - Easy to get started. Both java and .net have great XML support
  • SOAP - Great if you want to expose an API for everyone to use. A bit complex.
  • Protobof - Googles serialization protocol. Lot's of different implementations exist.
  • Custom made binary serialization - Built your own serialization library

How to load a .net assembly from java

Run the java application in mono ;)

http://www.ikvm.net/

Upvotes: 6

DaVinci
DaVinci

Reputation: 1391

You could use Tcp/Ip to let them communicate

Upvotes: 1

Related Questions