我遵循Microsoft Sync Framework工具和教程。Microsoft Sync Framework脫機存儲與SQLite數據庫
http://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e
我想使用SQLite作爲我的客戶數據庫,對我的服務器我有SQL Server 2008 R2中,我置備我的服務器數據庫,我能夠用瀏覽器緩存,本地運行一個實例存儲。但我想使用SQLite數據庫。 when clicking on the "sync" button, the SQLite database in the Android devices should be synchronized with SQL Server database
。你能指導我嗎?
this.sendRequest = function (serviceUri, successCallback, errorCallback, dir) {
TraceObj("[" + dir + " Request]:", serviceUri, this.dataObject());
// Construct HTTP POST request
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", serviceUri);
xmlHttp.setRequestHeader("Accept", "application/json");
xmlHttp.setRequestHeader("Content-Type", "application/json");
// Handle success & error response from server and then callback
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
var res = new SyncFormatter();
if (res.parse(xmlHttp.responseText)) {
TraceObj("[" + dir + " Response]:", serviceUri, res.dataObject());
alert("[" + dir + " Response]:", serviceUri, res.dataObject());
successCallback(res);
return;
}
}
TraceMsg("[" + dir + " Response Error]: ", xmlHttp.status + " Response: " + xmlHttp.responseText);
errorCallback(xmlHttp.responseText);
}
};
xmlHttp.send(this.toString());
};
}
在上面我得到xmlHttp.status是500
請檢查編輯 – Ponmalar
我不確定您在場景中如何配置http流量(我在窗口中使用fiddler),但是我會查看原始響應,因爲它會包含有關實際錯誤的信息。 – JuneT
什麼是提琴手?如何使用它? – Ponmalar