I currently have a prototype standalone java app that contacts a remote webservice to check for new messages. It retrieves and stores them in my local db. I have this request repeating every few seconds on a timer. I would like to change my acrhitecture before continuing with development. I would rather a notification system rather than polling.
The service provider (the people whos inbox i check for messages)provide a 'push' service which requires me to set up a simple web service that I publish and they notify me if I have a new message. The provide a template of the webservice I need to write.
My question is what is the best way/best practice for getting the new message from my webservice to my standalone java appl. Does my app now have to poll my webservice rather than the service providers for a message or can i give my web service a refernce to my app? How would I do this?
I wrote a simple tutorial web service at, http://www.builderau.com.au/webdev/soa/Setting-up-a-simple-Web-service-using-Java/0,339024680,339284524,00.htm
just to get used to web service file structure etc. The client has a reference to the service using the stub, is there a similar way to provide/generate a stub/skeleton to the webservice so that it can pass the message on to its client? Is this normal procedure?
Alternatively, could I just put all the app logic/db access etc in classes in the webservice either? Would this be usual? I am guessing its probably better to leave the service lightweight and just pass on the work elsewhere?
Anyway, as you can see I relatively clueless when it comes to webservice design and development. All help welcome.
Thanks in advance,