By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,997 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,997 IT Pros & Developers. It's quick & easy.

Can a Web Service send it's status to a client?

P: n/a
Hi,
I have a web service which is doing a lot of processing and taking 4-5
minutes to do so. The processing is split into several discrete steps and I
would like for the service to be able to tell the client when it is done
with each step.
I have tried to do this in a couple of ways and neither have worked. Any
ideas how I might get it to work?

What I have tried was:

1) Splitting out each processing step into a different web method and then
having the client call each method as the one before it finished.
The sort of work, in that the client knew what was happening when,
but the I could not get the service to remember the intermediate results and
thus it did everything after the first step on null objects. I thought of
passing the results back to the client and then having it pass them back to
the service, but there is too much data in the intermediate results for that
to be reasonable.

2) Having the WebService class have a private status string and a public
WebMethod GetStatus which returns that string. The service then updates the
string as appropriate and the client asks for it periodically.
The value of the status string never actually changed. I wrote code
(C#):
status = "Starting Blast analysis.";
BlastSolutionSet thisSolution =
DatabaseAccess.GetExperiment(experimentGuid);
thisSolution.BlastAll();
status = "Collating Blast Data";
thisSolution.AssignBlastResults();
status = "Querying NCBI";
thisSolution.CollectNcbiData();
status = "Done";
In debug mode, the value of status was always "".
Ay thoughts?
Thanks!
Ethan
Jan 29 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ethan,

To answer your first question, you need to use asynchronous websevices.
For such long running web-services asynchronous webservices is the
recommended approach. You can have a call-back delegate to notify the client.

Please refer the following url for further details

http://www.codeproject.com/cs/webservices/wsasync.asp
http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

To answer your second question, i think the code execution is not reaching
the path where the variable 'status' is getting populated
--
Thanks & Regards,
Mark Nelson
"Ethan Strauss" wrote:
Hi,
I have a web service which is doing a lot of processing and taking 4-5
minutes to do so. The processing is split into several discrete steps and I
would like for the service to be able to tell the client when it is done
with each step.
I have tried to do this in a couple of ways and neither have worked. Any
ideas how I might get it to work?

What I have tried was:

1) Splitting out each processing step into a different web method and then
having the client call each method as the one before it finished.
The sort of work, in that the client knew what was happening when,
but the I could not get the service to remember the intermediate results and
thus it did everything after the first step on null objects. I thought of
passing the results back to the client and then having it pass them back to
the service, but there is too much data in the intermediate results for that
to be reasonable.

2) Having the WebService class have a private status string and a public
WebMethod GetStatus which returns that string. The service then updates the
string as appropriate and the client asks for it periodically.
The value of the status string never actually changed. I wrote code
(C#):
status = "Starting Blast analysis.";
BlastSolutionSet thisSolution =
DatabaseAccess.GetExperiment(experimentGuid);
thisSolution.BlastAll();
status = "Collating Blast Data";
thisSolution.AssignBlastResults();
status = "Querying NCBI";
thisSolution.CollectNcbiData();
status = "Done";
In debug mode, the value of status was always "".
Ay thoughts?
Thanks!
Ethan
Jan 30 '07 #2

P: n/a
Any updates, did you proceed further ?
Please let me know whether my post was useful.

--
Thanks & Regards,
Mark Nelson
"Mark Nelson" wrote:
Ethan,

To answer your first question, you need to use asynchronous websevices.
For such long running web-services asynchronous webservices is the
recommended approach. You can have a call-back delegate to notify the client.

Please refer the following url for further details

http://www.codeproject.com/cs/webservices/wsasync.asp
http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

To answer your second question, i think the code execution is not reaching
the path where the variable 'status' is getting populated
--
Thanks & Regards,
Mark Nelson
"Ethan Strauss" wrote:
Hi,
I have a web service which is doing a lot of processing and taking 4-5
minutes to do so. The processing is split into several discrete steps and I
would like for the service to be able to tell the client when it is done
with each step.
I have tried to do this in a couple of ways and neither have worked. Any
ideas how I might get it to work?

What I have tried was:

1) Splitting out each processing step into a different web method and then
having the client call each method as the one before it finished.
The sort of work, in that the client knew what was happening when,
but the I could not get the service to remember the intermediate results and
thus it did everything after the first step on null objects. I thought of
passing the results back to the client and then having it pass them back to
the service, but there is too much data in the intermediate results for that
to be reasonable.

2) Having the WebService class have a private status string and a public
WebMethod GetStatus which returns that string. The service then updates the
string as appropriate and the client asks for it periodically.
The value of the status string never actually changed. I wrote code
(C#):
status = "Starting Blast analysis.";
BlastSolutionSet thisSolution =
DatabaseAccess.GetExperiment(experimentGuid);
thisSolution.BlastAll();
status = "Collating Blast Data";
thisSolution.AssignBlastResults();
status = "Querying NCBI";
thisSolution.CollectNcbiData();
status = "Done";
In debug mode, the value of status was always "".
Ay thoughts?
Thanks!
Ethan

Feb 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.