I need to call an API that's all in java from an existing .NET codebase. What's the best approach here? Writing a webservice in java that basically just forwards the calls to the API - or going with something like JNI4NET?
+1
A:
That depends. If it is a desktop application, you can use JNI. But for a web based application you have to use the web services.
RaviG
2010-05-24 07:37:40
The usecase is that I'm going to be calling into the java api from a WAS-hosted WCF service. Does that preclude the JNI approach?
Ciddan
2010-05-24 07:42:05
You can use JNI in this case.
RaviG
2010-05-24 09:18:28
A:
You can use jni4net, which is a JNI bridge between .Net and Java. (Props to Darin Dimitrov for providing this info in an answer to another question.)
T.J. Crowder
2010-05-24 07:52:20
I wish I could give Darin Dimitrov the answer, but I'll have to give it to you instead :) I ended up going with IKVM for the task, and after alot of work I got it working like a charm!
Ciddan
2010-05-25 09:49:51
@Ciddan: Yeah. I even posted a link to this question in the one I lifted the info from, but he didn't bite. :-) Have to settle for us both upvoting him, eh?
T.J. Crowder
2010-05-25 10:09:11