Hello everyone,
I'm relatively new to Web Service design, and right now I'm working on a project which requires a Web Service, and its interaction with another element (a 'Server' class which should always be connected to another system). The webservice works great by itself, and same thing with the server, the problem is how to communicate with each other. Let me try to clarify what I want to acheive:
. ___________________________________________
((Internet)) ---------> |
Java Web Service (1) --RMI---> Comm. Server (2) | <----------> Another Server
. ------------------------------------------------------------
"I get a post from the internet, my Java Web Service (1) receives the post and should execute a method [sendMessage(
String msg, String destination) or similar] on Comm. Server (2) which ALWAYS has an active connection to "Another Server".
So I need the following in order for my application to run correctly:
1. Launch Comm. Server (2) (so it can establish a connection to "Another Server" and remain always active)
2. A way of calling the method "sendMessage(msg,destination)" that resides on Comm. Server (2) from within Java Web Service (1).
The only solution I have come up with is communicate the two components using RMI, but I don't know if this is the correct way (and I'm having tons of problems getting the client RMI (the Web Service) to work).
Can anyone advise if you think I'm on the right track, of if you know/think there's a better way to acheive this same behavior? The main issue is that I ABSOLUTELY NEED the Server to be always running and I think I can't acheive this from within a "Dynamic Web Project", right?
Thank you guys in advance.