Summary

It's easy to call a Web Service method synchronously: Simply create a new instance of the proxy class created for you when you add a Web reference and then call the appropriate method. You will, however, have to wait until the results come back from the Web Service before posting your page, and this may be unacceptable to your users.

If you don't want to wait, you can call a Web Service method asynchronously, as well. It seems like a lot of effort to call a Web Service asynchronously, but it's really just a few more steps. In summary, here's what you must do:

  • Create a “start” procedure that calls the proxy class's BeginXXX procedure, where XXX is the name of the method you want to call in the Web Service. Pass BeginXXX a reference to ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.