The best thing would be to build a Java facade for an existing system that will talk to it using RMI, and on the other hand to provide something more standard - web services or, possibly, REST.
An added benefit of this approach is the protection that it gives you against outdated application errors and incorrect design decisions. For example, if there are any ugly workarounds you need to make to call an existing application, they can be safely hidden at the facade level without compromising the creation and integrity of the new application you are writing.
source share