You can do this even easier.

http://brennan.offwhite.net/blog/2008/10/21/simple-wcf-and-ajax-integration/