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!
# 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();
# 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!