Calling a Java API from .NET - best approach
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 j开发者_JS百科ava that basically just forwards the calls to the API - or going with something like JNI4NET?
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.)
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.
If its a web based application you can also look at using an RMI proxy object on the java server side and IIOP.NET on the .NET client side.
It will be orders of magnitude faster than web services.
精彩评论