Asynchronous webservice call, UI thread issue in asp.net

Discussion in 'ASP .Net Web Services' started by krishna, Aug 11, 2003.

  1. krishna

    krishna Guest

    Hi,
    I am calling a webmethod asynchronously using a callback
    delegate. I have implemented begin and end webmethods
    inside my webservice class.
    When I step into my client-side callback delegate, I see
    the right results returned by my web method. But as this
    callback delegate is getting executed on a seperate
    thread, I am not able to populate my UI element with
    result of the web service call. The same code works fine
    if the client is windows forms app. Also windows form
    controls implement ISynchronizeInvoke interface to
    marshal results to the UI thread. How can I do this in
    web forms? If I wait for the webmethod results on the UI
    thread by blocking it, I can work with UI elements. But I
    don't prefer to block the UI thread while my web method
    is being executed.
    Thanks for any feedback,
    Krishna
     
    krishna, Aug 11, 2003
    #1
    1. Advertising

  2. krishna

    Bill Safcik Guest

    Hi Krishna,

    Basically calling the web service asynchronously will not work from a web
    form.
    There is no guarantee that the thread that the initial request comes in on
    will stay around until the other thread that is calling the webservices
    webmethods. So it may not have anything to call back into.

    You could do this synchronously on 1 thread, so the calling thread will be
    blocked until the web service returns the data that needs to be populated
    in the UI.

    Thank you,

    Bill Safcik

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Bill Safcik, Aug 18, 2003
    #2
    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. Navin Mishra
    Replies:
    1
    Views:
    424
    bruce barker
    Apr 13, 2007
  2. Replies:
    5
    Views:
    1,620
    Roedy Green
    Jun 20, 2008
  3. Replies:
    5
    Views:
    404
    Raymond Roelands
    Jul 6, 2006
  4. René Preußler

    Asynchronous Call of WebService method within a WebService

    René Preußler, Oct 29, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    200
    René Preußler
    Oct 29, 2008
  5. René Preußler

    Asynchronous call of webservice methods

    René Preußler, Oct 29, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    137
    René Preußler
    Oct 29, 2008
Loading...

Share This Page