tags:

views:

107

answers:

1

I need to implement an WCF WS Addressing enabled web service that performs a long running process based on the method's arguments.

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

  1. The web method just takes the received arguments, creates a new GUID and stores all this info in a database table (or a MSMQ queue for that matter) or something like that. Then it returns the tracking GUID to the client. An external service (Windows Service probably) would be constantly polling the 'inbox', performing the long running process for each request, and generating the results and response to the callback service

Thanks In Advance

Sekar

+1  A: 

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

  • a webservice storing the data, starting a thread and returning the guid
  • the thread does the long term task and stores the result for its guid
  • a webservice returning the result for an guid or a fould if not finished yet.

Best practice would be to use an own deamon thread group for the long term tasks, each thread named with the guid. Override the uncaughtException() method of the group to store the exception as result for the guid on any error.

Arne Burmeister