This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client Accessing another client in java

 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

How can one client access another client in java assuming the two clients are two seperate web applications?

Regards,
Padma priya N.G.
 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually the clients don't talk directly to each other. There would be one central server, which would act as a data disbursement point (among other things)
What problem are you trying to solve and why do you wish the clients to talk to each other directly
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such communication should be avoided but a web application also has a client-server component within itself where the client are typically html based pages and the server side has Servlet based classes. You can make your webapplications' server sides communicate using HTTP based integration methods e.g REST (or plain HttpURLConnection classes) or other web available protocols like websockets.
 
Tim Cooke
Sheriff
Pie
Posts: 3060
126
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to provide some sort of API to your applications for them to use to communicate with each other. Something like a REST or SOAP API, or perhaps some sort of Message Bus. Because they are two separate applications, web or otherwise, you will not have direct access to its classes to be able to just call into a Java class.

Edit: Also, what they said. (You guys type faster than me)
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that the two applications are soap based applications in the same machine, should I use the context root of the first application in the url to access it from the other application

Thanks,
Padma priya N.G.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Padma priya Gururajan wrote:Assuming that the two applications are soap based applications in the same machine, should I use the context root of the first application in the url to access it from the other application

Thanks,
Padma priya N.G.


Generally yes but depends on how you are accessing the applications.
This is an integration solution design so you should take a step back and solve this as an integration problem just doing what works.
Are the applications deployed on the same server? Should they be in an ear file instead and share a common service layer? Is there a chance of the applications being deployed on different servers in the future? What data are the applications accessing from each other (Generally web layers do not have business processing so it is rare to need to call another web application from another)?
So then, what are you trying to access from the other web application here?
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applications are on the same server. One application is trying to use the services of another application. Is it possible to specify it in the url directly after deploying?
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Padma priya Gururajan wrote:The applications are on the same server. One application is trying to use the services of another application. Is it possible to specify it in the url directly after deploying?

See ALL the questions I asked above.
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both the applications have dynamic web projects. They can be run alone. How can one application access another application?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic