What do I use if I need something like Tomcat server that is always up and needs to be daemon that is always alive and perform HTTP web service requests using JAX-WS? Can I use Tomcat to be the request server that invokes the web services?
UPDATE:
I still don’t understand, sorry about that. I just want simple web service client that is able to send request to several endpoints. The thing is, that it needs to always alive (up like server or daemon). The reasons it needs to be alive is that it need to read and perform internal API calls and based on them to make the web service requests.
Your question is a little vague, but as far as I understand it you’re looking to develop a web service that respons to http requests.
This can easily be done using Tomcat, Jetty or any other servlet container. You would just deploy your application as a WAR in the servlet container, and the servlet container will take care of running your web services. I assume all requests will be plain http requests, so a good starting point will be the HttpServlet. Have a look at this tutorial to learn more.
Also keep in mind that Tomcat can manage database connections for you if the web service you’re developing needs to communicate with one. It’s the recommended way of doing it, as Tomcat will take care of opening, pooling and closing the database connections.
If you are looking to develop a deamon that executes requests against a remote web service, then I’d say Tomcat6 can be used for that too. A good starting point would be to simply configure a context listener which implements the methods contextInitialized() and contextDestroyed(). These two methods are invoked when the WAR is started and stopped. Depending on how and when you need to execute requests against a remote web service, I’d have a look at the Quartz Scheduler framework to execute the requests at given time intervals.