我遵循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