The easiest way to create Ajax Enable WCF service is to use Ajax Enabled WCF service templete in visual studio..
Let us go through Example step by step...
Step1:Create an ASP.NET 3.5 Website
Step2:Right click the project>Add New Item>Choose Ajax Enabled WCF Service>name the service as Demo..
Step3:As you see the Demo.cs is added to App_Code.. When you open the Demo.cs by default it is created like this
[ServiceContract(Namespace = "wcfDemo")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
Step4: Add the new method called getdata(int value)

Step5: Open Default.aspx page, In that add Scriptmanager from the toolbox and give its path..

Step6:Now add Html Button and Textbox inside the