• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Communication between two web applications running on different tomcat

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've two j2ee web applications running on two different tomcat instance.How do I communicate between them.I want to pass a map from one to another.I wont use shared db table for both the application.

Can you please tell some other ways for this.


Thanks
Anirban
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use a Servlet or web services.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Web services with Axis2 however pose a limitation of passing the user defined objects (or some predefined apis - ResultSet for example) through. The starting up solution is to pile everything on the HashMap and retrieve the required information. If not, Axis2 provides for serialization of your class to flatten it to pass through and get accepted.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is not just with Axis, all kind of web services have limitations. They work well with primitives (including String), arrays of primitives, objects which contain primitives and/or their arrays and arrays of such objects. For everything else there is no straightforward way and they are not portable as well.
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For situations where you have control over both sides of the wire, and where no other clients need to be supported, I wouldn't recommend web services. Their overhead is real, and it wouldn't really pay off in this situation.

If the JVM version is the same on both sides, you could serialize the object over an HTTP connection. Or omit HTTP altogether, and serialize them over a Socket connection.

Or, more cross-platform and cross-version compatible, use an HTTP POST where the parameters are the keys and values of the Map as strings. That wouldn't work so well if the objects are structured, though (as opposed to being more or less primitives than can easily be converted to/from strings).
 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I gave a look to Google App Engine's URLFetch API, which can be used for the web service invocation and HTTP POST or HTTPS POST for that matter. Is there any pre-existing APIs available coded specifically for (read 'in') Java?
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic