Web bridge between Java client to C# class library [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
开发者_运维知识库Closed 7 years ago.
Improve this questionI have an class library containing approximately 10 dll's written in C# 3.0/.NET 3.5. The library supply API access to my product running a remote server. Communication is done using TCP sockets.
I am looking for a way to write a client app for android/Linux in java. The problem is that the API is pretty big and converting it from C# to java can take a lot of resources and time. Trying to avoid converting.
Anyone can think about a way achieving a working android client that uses the C# API without having to embed it into the client? Thought about getting a web service to do all the work against the core API and access it from java, the problem is that the TCP connection to the server has to be kept open at all time and a web service solution is stateless. Maybe a way to use a web service with persistent connection (is there such a thing?). Any creative ideas?
Why does the tcp connection have to be open all the time? A webservice would be a nice solition because on the Java side you can generate the stubs/proxy classes and have virtually no work left.
Here a creative idea: Implement a binary protocol over a persistent TCP connection that allows you to call any method inside of your server. For example the client might send:
{ class: 'BankService', method: 'StealMoney', parameters: { amount: 123 } }
And your server process would execute this using reflection.
Sorry it took so long to respond to this. In non-Android scenarios, JNBridgePro (www.jnbridge.com) would be a good solution. We've never had anyone run the Java side on Android, but we'd be happy to work with you to get that working.
Disclosure: I work for JNBridge.
精彩评论