我遵循了 Microsoft Sync Framework 工具和教程。
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。