0
我正在使用Microsoft Sync Framework將Android設備上的Datadictionary的詳細信息與SQL Server同步。最初獲得成功以同步來自sql server的所有數據。但添加一些數據後,當點擊同步按鈕獲得以下錯誤。你能告訴我有人遇到過嗎?Microsoft Sync Framework - ServerBlob爲空錯誤
[Sync Error]:Error occurs during sync. Please check logs below.
[Upload Change Response Error]: 500 Response: <ServiceError xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorDescription>System.InvalidOperationException
 serverBlob is empty
 at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.ApplyChanges(Byte[] serverBlob, List`1 entities)
 at Microsoft.Synchronization.Services.UploadChangesRequestProcessor.ProcessRequest(Request incomingRequest)
 at Microsoft.Synchronization.Services.SyncService`1.ProcessRequestForMessage(Stream messageBody)
 
 
 </ErrorDescription></ServiceError>
在下面的代碼,同步按鈕
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());
};
}
它是第一次同步嗎?你如何在客戶端存儲blob? – JuneT
@JuneT:請檢查編輯 – Ponmalar
您還沒有回答我的問題......當您上傳客戶端上的數據並且服務器blob尚未初始化時,通常會在第一次同步時發生服務器blob錯誤。再次,你如何存儲你的blob並存儲初始值? – JuneT