Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Async Webservice, State and progress.

Reply
Thread Tools

Async Webservice, State and progress.

 
 
Jonathan
Guest
Posts: n/a
 
      12-08-2004
Hello all,

I don't have too much experience developing webservices, specially the async
side of it, but i'm trying to develop an (web)app that needs an async call to
a webservice.

I'm trying to have a ASP.NET page, that calls a webservice, and refreshes
itself to show the current progress/status of the webservice. (eg. a
progress-bar)

Reading through this page
(http://msdn.microsoft.com/library/de...nethowto08.asp)
has helped a lot, as it describes exactly what i need, except for the part
that i need to poll for a current status as well.

Does anybody know how/where to implement such a poll in that sample, as i
can't figure out where and how i'd put it.
(I've been reading through just about every page i can find about the
subject, but haven't been able to find anything that sheds some light).

TIA.


 
Reply With Quote
 
 
 
 
Mujtaba Syed
Guest
Posts: n/a
 
      12-08-2004
Hi Jonathan:

If you have a web method called XXX (retval XXX (params)), WSDL.exe will
generate three corresponding methods in the proxy:

* retval XXX (params)
* IAsyncResult BeginXXX (params)
* retval EndXXX (IAsyncResult)

Now the first one is the sync call while the second and the third form the
async call. For an async call, you can call BeginXXX, then go and do
something else, and comeback to call EndXXX to get the result. IAsyncResult
connects a particular call of BeginXXX to its corresponding EndXXX. But
there is still another probles (as you have pointed out). How does one know
its time to call EndXXX. That is solved by a property exposed by
IAsyncResult called IsCompleted. Using this you can poll your current active
call.

For more info:
http://msdn.microsoft.com/library/de...chronously.asp

Thanks,
Mujtaba.


"Jonathan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello all,
>
> I don't have too much experience developing webservices, specially the

async
> side of it, but i'm trying to develop an (web)app that needs an async call

to
> a webservice.
>
> I'm trying to have a ASP.NET page, that calls a webservice, and refreshes
> itself to show the current progress/status of the webservice. (eg. a
> progress-bar)
>
> Reading through this page
>

(http://msdn.microsoft.com/library/de...-us/dnpag/html
/scalenethowto08.asp)
> has helped a lot, as it describes exactly what i need, except for the part
> that i need to poll for a current status as well.
>
> Does anybody know how/where to implement such a poll in that sample, as i
> can't figure out where and how i'd put it.
> (I've been reading through just about every page i can find about the
> subject, but haven't been able to find anything that sheds some light).
>
> TIA.
>
>



 
Reply With Quote
 
 
 
 
Mujtaba Syed
Guest
Posts: n/a
 
      12-09-2004
Having re-read your question, I realized that you need to know "how much"
(whatever that would mean) of the web method has executed and "how much" is
remaining.

There is no way to predict this but the web service client can simulate this
by storing a history of turnaround and predicting the time for n+1th
executing by averaging the first n executions. This is just an approximation
like all time based progress bars.

Also, progress bars based on data downloaded to the total data to be
downloaded make more sense.

Thanks,
Mujtaba.

"Jonathan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello all,
>
> I don't have too much experience developing webservices, specially the
> async
> side of it, but i'm trying to develop an (web)app that needs an async call
> to
> a webservice.
>
> I'm trying to have a ASP.NET page, that calls a webservice, and refreshes
> itself to show the current progress/status of the webservice. (eg. a
> progress-bar)
>
> Reading through this page
> (http://msdn.microsoft.com/library/de...nethowto08.asp)
> has helped a lot, as it describes exactly what i need, except for the part
> that i need to poll for a current status as well.
>
> Does anybody know how/where to implement such a poll in that sample, as i
> can't figure out where and how i'd put it.
> (I've been reading through just about every page i can find about the
> subject, but haven't been able to find anything that sheds some light).
>
> TIA.
>
>



 
Reply With Quote
 
Jonathan
Guest
Posts: n/a
 
      12-09-2004
I'm sorry if my question was unclear.
I'll try to elaborate.

What i'm trying to achieve is:
* A webservice with 1 long running task
* The webservice keeps track of the progress of this task
* An aspx page that polls the webservice for this progress

Normally i'd try and do this with the aid of session-state, but i've read
that session-state in combination with async calls doesn't work as expected.
The Microsoft sample i mentioned does run the way it should, but only polls
the webservice whether it is completed.
I'd need to modify this, so that it can poll for it's current progress.

I don't know whether it's at all possible to do this, but it seems to me it
shouldn't (have) to be that difficult?

I hope this clears things up.

TIA.


"Mujtaba Syed" wrote:

> Having re-read your question, I realized that you need to know "how much"
> (whatever that would mean) of the web method has executed and "how much" is
> remaining.
>
> There is no way to predict this but the web service client can simulate this
> by storing a history of turnaround and predicting the time for n+1th
> executing by averaging the first n executions. This is just an approximation
> like all time based progress bars.
>
> Also, progress bars based on data downloaded to the total data to be
> downloaded make more sense.
>
> Thanks,
> Mujtaba.
>
> "Jonathan" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello all,
> >
> > I don't have too much experience developing webservices, specially the
> > async
> > side of it, but i'm trying to develop an (web)app that needs an async call
> > to
> > a webservice.
> >
> > I'm trying to have a ASP.NET page, that calls a webservice, and refreshes
> > itself to show the current progress/status of the webservice. (eg. a
> > progress-bar)
> >
> > Reading through this page
> > (http://msdn.microsoft.com/library/de...nethowto08.asp)
> > has helped a lot, as it describes exactly what i need, except for the part
> > that i need to poll for a current status as well.
> >
> > Does anybody know how/where to implement such a poll in that sample, as i
> > can't figure out where and how i'd put it.
> > (I've been reading through just about every page i can find about the
> > subject, but haven't been able to find anything that sheds some light).
> >
> > TIA.
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
State machine outputs and tri-state Grumps VHDL 2 02-13-2008 11:26 PM
difference between asp session state and asp.net session state. archana ASP .Net 0 03-13-2007 11:42 AM
ASP.NET 2.0 Session State and ASP.NET 1.1 Session State jnickfl1 ASP .Net 0 09-18-2006 03:23 PM
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
Async webservice call in async webpage (.Net 2.0) does not return Steven ASP .Net Web Services 0 11-30-2005 01:06 AM



Advertisments