2
我似乎無法找到如何從jQuery發佈到WCF Web服務並捕獲返回的布爾值的示例。這是我的代碼到目前爲止返回JSON數據:jQuery Ajax WCF POST - 返回布爾值
的Javascript
function VerifyPINData(pin) {
$.ajax({
type: 'POST',
url: "http://localhost:8523/WebService/VerifyPINData?pinData=" + pin,
data: JSON.stringify,
contentType: 'application/json; charset=utf-8',
success: function(data){ alert("result is: " + data); },
error: function() {alert("error"); },
complete: function() { alert("complete"); }
});
}
WCF
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "VerifyPINData?pinData={pinData}")]
bool VerifyPINData(string pinData);
任何幫助,將不勝感激。