Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Làm thế nào để thiết kế và phát triển một trang web N-cấp bằng cách sử dụng các tính năng XML của ASP.NET 2.0 và SQL Server 2005. Để hỗ trợ thiết kế này, chương này thảo luận về làm thế nào để đóng gói logic truy cập dữ liệu trong các hình thức của các thành phần tái sử dụng. Làm thế nào để làm việc với một cột kiểu dữ liệu XML | Chapter 13 Figure 13-7 Asynchronous Web Service Methods The previous section discussed how to call Web services asynchronously over HTTP using the client-side capabilities of the .NET Framework. This approach is an extremely useful way to make calls to a Web service without locking up your application or spawning a bunch of background threads. This section discusses asynchronous Web service methods that provide similar capabilities on the server side. When you invoke a normal synchronous ASP.NET Web service method the response for a synchronous Web method is sent when you return from the method. If it takes a relatively long period of time for a request to complete then the thread that is processing the request will be in use until the method call is done. Unfortunately most lengthy calls are due to something like a long database query or perhaps a call to another Web service. For instance if you make a Web service call across the Internet the current thread waits for the Web service call to complete. The thread has to simply wait around doing nothing until it hears back from the Web service. In this case if you can free up the thread to do other work while waiting for the Web service you can increase the throughput of your application. Waiting threads can impact the performance of a Web service because they don t do anything productive such as servicing other requests. To overcome this problem you need a way to be able to start a lengthy background process on a server but return the current thread to the ASP.NET process pool. When the lengthy background process completes you would like to have a callback function invoked so that you can finish processing the request and somehow signal the completion of the request to ASP.NET. This is exactly what ASP.NET offers through asynchronous Web methods. 454 XML Web Services How Asynchronous Web Methods Work When you write a typical ASP.NET Web service using Web methods Visual Studio simply compiles your code to create the