Async Webservice, State and progress.

Discussion in 'ASP .Net Web Services' started by Jonathan, Dec 8, 2004.

  1. Jonathan

    Jonathan Guest

    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/default.asp?url=/library/en-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.
    Jonathan, Dec 8, 2004
    #1
    1. Advertising

  2. Jonathan

    Mujtaba Syed Guest

    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/d...ml/cpconinvokingwebservicesasynchronously.asp

    Thanks,
    Mujtaba.


    "Jonathan" <> wrote in message
    news:...
    > 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/default.asp?url=/library/en-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.
    >
    >
    Mujtaba Syed, Dec 8, 2004
    #2
    1. Advertising

  3. Jonathan

    Mujtaba Syed Guest

    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" <> wrote in message
    news:...
    > 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/default.asp?url=/library/en-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.
    >
    >
    Mujtaba Syed, Dec 9, 2004
    #3
  4. Jonathan

    Jonathan Guest

    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" <> wrote in message
    > news:...
    > > 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/default.asp?url=/library/en-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.
    > >
    > >

    >
    >
    >
    Jonathan, Dec 9, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charlie Zhang
    Replies:
    3
    Views:
    1,252
    Paul Lutus
    Aug 16, 2004
  2. =?Utf-8?B?RGF2ZQ==?=

    Async Pages & Ajax progress bar?

    =?Utf-8?B?RGF2ZQ==?=, Oct 31, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    821
    Jason Hartsoe
    Dec 11, 2007
  3. RSH
    Replies:
    0
    Views:
    363
  4. ullbergm

    Progress of a async webservice call

    ullbergm, Nov 19, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    219
    ullbergm
    Nov 19, 2004
  5. Steven
    Replies:
    0
    Views:
    360
    Steven
    Nov 30, 2005
Loading...

Share This Page