Asynchronus web service using WS Addressing

I need to implement a WCF WS Addressing web service that does a lengthy process based on method arguments.

The client does not need to wait for the result because it will be delivered directly to the database table. However, the web method should actually return the tracking ID number (actually a GUID), so the client can use that to retrieve the results from the database.

  • The web method just takes the arguments it receives, creates a new GUID, and stores all of that information in a database table (or MSMQ queue), or something like that. It then returns the tracking GUID to the client. An external service (possibly a Windows service) will constantly check the "inbox", execute a lengthy process for each request, and generate results and respond to the callback service

Thanks in advance

Sekar

+1


source to share


1 answer


What is your question? But from your description, the webservice itself is not asynchronous. In java webapp, I would implement a simple webapp like:

  • a web service storing data, starting a stream and returning a guid
  • the thread performs a long term task and stores the result for its guid
  • a web service that returns the result for guid or fould if not finished yet.


The best practice would be to use its own group of deamon threads for long term tasks, each thread named with a guid. Override the group's uncaughtException () method to keep the exception as the result for guid on any error.

+2


source







All Articles