Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2003

Tip: Looking for answers? Try searching our database.

Asynchronous webservice call, UI thread issue in asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
krishna - 11 Aug 2003 04:24 GMT
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
Bill Safcik (ms) - 18 Aug 2003 21:06 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.