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?
We have heard that it is not possible to call Java code from C# and vice-versa, but jni2net makes it possible by mixing both source code into a single executable file.
Java fetches most syntax from C and C++. Since it is a platform-independent language, you can run Java on various platforms . Net works on a common language infrastructure, supports arrays, type checking, checks variables and garbage collection.
The first way provides evidence that Java can be linked to C# at the native code level, albeit through C++ wrappers. The second is a means for retaining the useful applet feature of Java in the server- side architecture of web services written in C#.
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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With