javascript - Calling WCF service POST method from jQuery Ajax -
i have following wcf method
[operationcontract] [webinvoke(method = "post")] public string helloworld(string stest) { return stest.tostring(); }
and have jquery ajax client code below
$.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: '../../service.svc/helloworld', data: { 'stest': 'testdata' }, datatype: 'json', success: function (resp) { }, error: function (error) { alert(error); } });
when ajax invoke hellowworld method,
error networkerror: 500 internal server error.
how call wcf post method jquery ajax.
Comments
Post a Comment