providing progress to client

C

cgambol

I am using vs 2003 and .net 1.1.

I have a web service that does some work on a list of objects.
Each object takes about a second to process.
Lets say the client sends me a list of 1000 objects.
This will take me 1000 seconds to complete.

While processing I would like to be able to give the client some
feedback (if they want it).

I was thinking of having 2 methods:

one to do the work: DoWork(uniqueId as string, ...)

and

one to provide status: GetProgress(uniqueId as string) as double

DoWork would save the progress in an application variable.

GetProgress would get the value out the the app variable and return it
to the client.

Does this sound right or is there another way I should do this.

I also thought about writing the progress to a database and let the
client query the db for the current value???


Thanks,

tcochunk
 
S

Scott M.

This is not possible with web services, since one web service works via one
request and one response (you can only call one method at a time and only
send one response at a time). This is the price you pay for working with a
distributed architecture. Unless you created a client side application that
could "poll" a web service continuously.
 
C

cgambol

Because it is a long running operation the call will be made from the
client async'ly. Once they make the 1st call (async'ly) they are free
to make other requests of the same web service. One of the other
calls would be: what is the status of the first call I made?

This should absolutely be possible.

I just want to know if my inteneded approach sounds reasonable?

tcochunk
 
D

Damon Allison

Using .net 1.1 that is a reasonable approach. If you have multiple
clients watch performance. You could look into a duplex channel to
implement callbacks with WCF but that is not an option here.


Damon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top