Consuming a WCF service from an ASP.NET AJAX client

Nowadays, more and more web application development platforms have adopted AJAX features so as to provide rich client-side interaction and user experience in browser-based applications. ASP.NET AJAX is one of the representatives of the AJAX-enabled web application development platform. One cool feature of ASP.NET AJAX is that it can use script code to invoke XML Web Services within the hosting web application. As a unified service development platform, WCF also provides support for building services that can be consumed by an ASP.NET AJAX client.

In this recipe, we will demonstrate how to build an ASP.NET AJAX-enabled WCF service and consume it from an ASP.NET web page.

How to do it...

In the sample ...

Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.