wood burning stoves 2.0*
The moose likes Tomcat and the fly likes What are good ways to send request from one server to another server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "What are good ways to send request from one server to another server?" Watch "What are good ways to send request from one server to another server?" New topic
Author

What are good ways to send request from one server to another server?

Satyajit Bhadange
Ranch Hand

Joined: May 13, 2010
Posts: 104
I have one Tomcat Server A and Tomcat Server B running.
Both A and B can be accessed through Browser.
But A needs few services from B. What is a good way to send request to server B from server A ?
Can I use Remote method Invocation through Servlets ?
If yes then how to implement the same ?
I have implemented RMI through java but not through servlets ?


Thanks
user101
Problems And Solutions - Algorithms
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

That depends on what those services are and how they are implemented. For example there is no point in expecting to access a service via RMI unless it is written to accept RMI requests. So if your Server B accepts requests from a browser, then that means it is accepting requests via HTTP and returning the responses the same way. That isn't RMI.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41603
    
  55
For something running in a servlet container it would be natural to use HTTP - how about a RESTful web service? The JAX-RS API works well for that, and its reference implementation (called Jersey) works nicely in web apps.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What are good ways to send request from one server to another server?