Json Response not getting while using POST method for Insert

Dec 14 2018 7:02 AM
I have created a simple webapplication  where i am inserting the data through WCF service using AJAX
 
Data is inserted but it is not not going to the ajax success function where i will get the response of the method . im not able to solve 
 
here is my code............. 
 
$.ajax({
url: "http://localhost:62215/Services/MyService.svc/rest/CreateApplications",
type: "POST",
data: JSON.stringify(objApp),
async: false,
dataType: "json",
contentType: "application/json;charset=UTF-8",
 
success: function (response) {
debugger;
console.info(response);
alert('Inserted, i am from success function');
},
failure: function (msg) {
console.info(msg);
}
});
 
using Newtonsoft.Json;

public string CreateApplications(Application app)
{
BusinessLogic.addApplication(app);
var chk = new check
{
subject = "hello! " + "Anil",
description = "Anil" + " Years Old"
};
 
return JsonConvert.SerializeObject(chk);
}
 
public class check
{
public string subject { get; set; }
public string description { get; set; }
}
 
Data is inserted their is no issu ..... but i want return json string

Answers (2)