calling WCF using AJAX and jquery

Posted by Mani5155 under ASP.NET AJAX category on | Points: 40 | Views : 1916
type: "POST",
dataType: "json",
url: "../Service1.svc/myservice",
data: '{ 'field_name=" '+'value'+'",'....}', //for passing json formatted input(argument) to method 'myservice'
contentType: "application/json; charset=utf-8",
success: function (r) {
alert(eval('(' + r.d.toString() + ')')); //your output also in json format only
error: function (e) {
alert("your error message");


In above code you can call WCF using ajax with json formatted input and json formatted output

Comments or Responses

Posted by: Vinay13mar on: 10/15/2012 Level:Starter | Status: [Member] | Points: 10
Check the below link this will help you

Login to post response