I have a GWT project A and another project B on another computer. Now I want to call the business logic in project B whenever a user presses a button in project A. Project B cannot be a GWT project because of other restrictions.
How can I do that?
I tried to use sockets, but that is not possible with GWT: java.net.Socket is not supported by Google App Engine’s Java runtime environment. If a uncheck the usage of GWT App Engine in the project properties, my application does not start anymore (java.lang.NoSuchMethodError’s).
So what I need is a behaviour like the following:
- Fire an event in project A
- Notice that the event was fired and call method x
After getting notification from the client, about the event, you can use
HttpURLConnectionto contact the project B. Project B must have HTTP interface to handle the request from the A.You can read more details about
HttpURLConnectionhere: http://code.google.com/appengine/docs/java/urlfetch/Calling certain method on the B project is matter of good contract between the request parameters and the mechanism for calling methods(I guess some kind of mapping).