Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return data from a Java process back to calling C#. Possible?

Tags:

java

c#

process

I'll explain breifly my situation and hopefully you will be able to advise if what im wanting to do is possible.

I have an existing java application that I am wanting to split into modules. To handle and control these modules Im going to write a module manager in C#.net. Due to the size of the existing program the bulk of the existing modules are not going to be rewritten in .net yet and remain as java modules.

Is it possible to call a java "module", pass it parameters and have the java module return a value ( other than an int )?

I apologise for not knowing much about this area.

Kind Regards

Ash

like image 423
user589195 Avatar asked Jun 26 '26 14:06

user589195


2 Answers

Hmm... maybe some kind of MessageQueues like MSMQ, Apache ActiveMQ or IBM WebsphereMQ can solve your problem.

On the queues you can store and receive XML-Messages with all the Information you need.

Some information about this can be found here: http://msdn.microsoft.com/en-us/library/ms973816.aspx

Another approch can be to work with console output .. but IMHO this is not a good solution.

like image 128
MacX Avatar answered Jun 28 '26 02:06

MacX


I would instantiate the Java as a separate service and call it using (say) web services, Hessian etc.

Alternatively, have you looked at jni4net ?

like image 35
Brian Agnew Avatar answered Jun 28 '26 02:06

Brian Agnew