Results 1 to 4 of 4
Thread: How to Call a java service
- 10-14-2009, 03:53 AM #1
Member
- Join Date
- Oct 2009
- Location
- NJ, USA
- Posts
- 3
- Rep Power
- 0
How to Call a java service
I am working to build a home automation web application. I have multiple automation devices with RS232 interfaces. I have successfully interfaced with these devices using demo code. Now I would like to create a Java service/Daemon that read/writes to the COM ports and maintains the state of the devices for a tomcat web application to interact with.
2 things I am looking for are what is the best way to create this Daemon and how do I call the daemon from my web app?
I think my terminology is not accurate as I do not find much material when I search the web for "howto call Java service"
I am relatively new to java and familier with the basics of java, OO, etc.
Platform for development is eclipse on Windows. Server is Debian Linux.
Links to how to, proper terms and sample code would be appreciated.
I am more of a hacker than a student - try it don't study it.
Thanks,
Mike
- 10-16-2009, 04:48 PM #2
Xml rpc
How about a kind of XML-RPC, as Redstone XML-RPC Library
In the past I have even built my own custom integration using the unix fifo, that is only useful for simple line oriented kinds of messages, and is one way..
an XML RPC over a plain TCP socket is the most flexible. You build the 'server' side into the java service and have it open up a socket on the local host. then your web application, in a servlet handler you implement the XML RPC 'client' that connects to the local port.
If the connection is not intended to be accessed by other machines, you can bind the socket on the loopback address only, but with some more security or authentication mechanisms it is convenient to allow the service even to run on a different machine as the webapp if that is ever needed.
- 10-17-2009, 03:28 AM #3
Member
- Join Date
- Oct 2009
- Location
- NJ, USA
- Posts
- 3
- Rep Power
- 0
Thanks travishein,
after posting this I found articles on creating a program and opening a socket as you mention, to be the service. That seems to be the best method for quick POC to which can be built more advanced functionalitiy.
I really like your suggestion of using XML, I think that will allow me to standardize the server side making the client platform more independent.
Right now the server I have to playwith is a mothballed old desktop with very little memory. Though in it's day I was quite proud to say that was my PC. Maybe I will win the Tiger direct PC a day giveaway to upgrade the computing environments . . .
- 10-17-2009, 03:30 AM #4
Member
- Join Date
- Oct 2009
- Location
- NJ, USA
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
how to call service method inside another service
By kirtichopra2003 in forum Web FrameworksReplies: 1Last Post: 10-24-2009, 02:19 AM -
Consume a .net web service with a java client
By pauldj54 in forum New To JavaReplies: 3Last Post: 07-15-2009, 11:53 AM -
Consuming a Web Service using Java
By gopikrishnatb in forum Web FrameworksReplies: 2Last Post: 03-02-2009, 09:59 AM -
Java Message Service
By Java Tutorial in forum Java TutorialReplies: 0Last Post: 06-09-2008, 09:57 PM -
Java Service Wrapper 3.3.0
By Java Tip in forum Java SoftwareReplies: 0Last Post: 03-29-2008, 01:04 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks