Asynchronous webservice call, UI thread issue in asp.net

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Asynchronous webservice call, UI thread issue in asp.net

    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 Guest

  2. Similar Questions and Discussions

    1. asynchronous call timeout
      rHow could I set a timeout for this asynchonous call? I tried wait.one, but didn't work. thanks a lot. private void Button1_Click(object...
    2. Asynchronous Web Service Call
      Karl, If the webservice is out of process (whether it be on another machine or just out of process), then it will be executed using a thread from...
    3. asynchronous call to web service from a web page
      My web service is to update a database. When user clicks on a button on a web page, it calls web service to update database. With hundred...
    4. Web service Asynchronous call fails
      Hi I created a webservice with a simple we method to increment a number passed from the client(a console app) . Then i call this web service method...
    5. Asynchronous Web Service Call Fails
      Hi I created a webservice with a simple we method to increment a number passed from the client(a console app) . Then i call this web service method...
  3. #2

    Default RE: Asynchronous webservice call, UI thread issue in asp.net

    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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139