async webservice call

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you show a progress bar while you are waiting for a web serice ?

is this a VB winform stathread issue ?

I'm familiar with calling web services async, but nothing I've tried allows
me to do any work while I'm wating for the webservice.

I'd like to just use the polling approach on the async result objet but the
iscompleted never gets set.

Tim
 
hi Tim,
progress bars and web service requests don't work naturally together.
the nature of a web service request is that it is a single operation,
and you don't hear anything back from the server until the result comes
back (or an exception). so there aren't any easy ways to show the
progress of a request.
what i do in my application is use an 'ActivityBar' control, which is
like a progress bar, but it slides forwards and backwards, just telling
the user that something is happening, but not giving any indication of
progress. you can download this control on
www.ibenza.com/Dev/ActivityBar.zip. this is an improved version of
someone else's control.

if you're doing file upload, you can break the file up into small
chunks and give progress as each chunk is uploaded. see codeproject
article:
http://www.codeproject.com/cs/webservices/SplitMergeWebService.asp

if you're getting stuck on a basic asynchronous web service call, have
a read over that section of the docs, and the example there:
http://msdn.microsoft.com/library/e...oncreatingasynchronousxmlwebservicemethod.asp

hope this helps
tim
 
Thanks for pointing me to an interesting control.

After thinking about this a bit more I realized I can use a timer event
while I wait for the async callback from the webservice. The timer event can
drive the progress bar / activity bar

problem solved :)
Tim
 
if you're using the activity bar, there is no need for a timer. just
call activityBar.Start() before you call the web service async method.
and when the callback gets called, call Stop() on the activity bar.
i presume you aren't showing true progress for the operation with the
timer, just incrementing it every second or something to let the user
know that something is happening? what do you do when it reaches the
maximum value of the progress bar?

tim
 
Tim,

yes your right, I don't need to fool around with a timer.
I've got the Activity bar in my status bar and it looks good.

How can I change the block image that is tucked into the resource file?

thanks for your helpp!

Tim
 
hi Tim,
if you have Visual Studio.Net, you can include the ActivityBar.cs file
in a windows forms project. then you can open it up. it's a component
so you don't have any drawing surface. there is one control -
imageList1. this contains the gif file that is used to create the
scrolling effect. you can change this as needed.
let me know how you get on.
cheers
tim
 
Back
Top