Comunication beetwen 2 web applications

Hi

I stay developing a base web application which should be able to comunicate with other web applications (like application on front of module applications). The colaborating applications can be in the same application server or distributed against base web application...

Well, my question is if JMS is the right option for me, and if not, which is the correct.

Thanks at all. Bye!

[409 byte] By [andreuperea] at [2007-11-27 4:04:53]
# 1
use URL and HTTPConnection to send mesaage between each other
sandeep_ra at 2007-7-12 9:09:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

sender application

URL downeyjrURL = new URL("http://localhost:8080/WPSTOSAPXIPOC/XMLParserToMQSeries");

HttpURLConnection c = (HttpURLConnection) (downeyjrURL.openConnection());

c.setDoOutput(true);

c.setRequestProperty("Content-type","text/xml");

InputStreaminputS=c.getInputStream();

BufferedReader fromServer=new BufferedReader( new InputStreamReader(inputS));

String inputLine;

while((inputLine = fromServer.readLine()) != null)

System.out.println(inputLine);

c.disconnect();

Reciver application

BufferedReader requestData = new BufferedReader(new InputStreamReader(request.getInputStream ()));

StringBuffer stringBuffer = new StringBuffer();

String line;

try{

while ((line = requestData.readLine()) != null) {

stringBuffer.append(line);

}

} catch (Exception e){}

return stringBuffer.toString();

sandeep_ra at 2007-7-12 9:09:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
I would consider EJB or JMS *before* raw http. It all depends on if you need a synchronous communication (like an RPC), then you need EJB; if your communication is asynchronous (send and forget) you can use a JMS queue.Good luck!
JorgeBa at 2007-7-12 9:09:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
For asynchronous then JMS is a good bet. For synchronous I would use Spring Remoting
SteveNaivea at 2007-7-12 9:09:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...