Hi all,
I am designing a webservice which requires a single instance of an object to be created, and then run continously while other webservices access it. I only have experience with simple webservices at the moment, passing text around etc., and so any help would be appreciated.
I have no knowledge of EJB, but would a solution here be to utilise EJB, and pass the bean to each webservice that needs it, (it needs to be synchronized obviously). The problem with my current approaches is the persistence of the object, I want each webservice to be accessing the same object.
Many thanks in advance,
Paul
-
Advice in designing web service (3 messages)
- Posted by: Paul Andre
- Posted on: August 25 2004 10:51 EDT
Threaded Messages (3)
- Advice in designing web service by Sohail Sikora on August 25 2004 12:35 EDT
- Advice in designing web service by Paul Andre on August 25 2004 17:03 EDT
- Questions by Web Master on August 25 2004 14:14 EDT
-
Advice in designing web service[ Go to top ]
- Posted by: Sohail Sikora
- Posted on: August 25 2004 12:35 EDT
- in response to Paul Andre
If all the webservices are deployed under the same application context, you can:
- Create the bean in a Filter
- Add the instance of the bean to the web application context
- Use the the bean from the app context when the servlet (I am assuming Axis or some other Servlet based implementation)
I maybe VERY wrong here but certainly a start to what could be an interesting discussion. -
Advice in designing web service[ Go to top ]
- Posted by: Paul Andre
- Posted on: August 25 2004 17:03 EDT
- in response to Sohail Sikora
Sorry, what do you mean by application context? :-)
And yes, I am using Axis on Tomcat.
I'll elaborate slightly to help in my view of what I would like to happen (all this happens within a controlled workflow);
1. Initially an object (TaskBagManager) will be created, and within this, a Hashtable or something similar initialised.
2. A reference to this will be returned.
3. When certain constraints have been met, a task will fire off, which will add detail to the Hashtable created in (1), by calling some exposed method of the object.
4. Repeat 3 for multiple tasks.
All the while, the object (TaskBagManager) created in (1) is running away, and every n seconds performs some analysis on the Hashtable (which should be being updated every so often) and performs some task based on the analysis.
The reason to expose this as a webservice is partly proof of concept, but when released in the wild it will be needed for interoperability over many worldwide sites.
Any help would be appreciated! Thanks :-) -
Questions[ Go to top ]
- Posted by: Web Master
- Posted on: August 25 2004 14:14 EDT
- in response to Paul Andre
1. Why are you using web services at all?
2. What does your singleton do?