Azure iOS移动客户端:服务器未返回预期项目
我正在从Microsoft Azure Mobile Services for iOS更新示例Todo应用程序,以使用表存储而不是默认的MSSQL后端。此时,当我尝试插入一个新项目时,客户端中出现以下错误:Azure iOS移动客户端:服务器未返回预期项目,ios,node.js,azure,Ios,Node.js,Azure,我正在从Microsoft Azure Mobile Services for iOS更新示例Todo应用程序,以使用表存储而不是默认的MSSQL后端。此时,当我尝试插入一个新项目时,客户端中出现以下错误: 2014-11-22 11:06:44.895 xxx[6942:869598] ERROR Error Domain=com.Microsoft.WindowsAzureMobileServices.ErrorDomain Code=-1201 "The server did not re
2014-11-22 11:06:44.895 xxx[6942:869598] ERROR Error Domain=com.Microsoft.WindowsAzureMobileServices.ErrorDomain Code=-1201 "The server did not return the expected item." UserInfo=0x7a6b1040 {NSLocalizedDescription=The server did not return the expected item., com.Microsoft.WindowsAzureMobileServices.ErrorResponseKey=<NSHTTPURLResponse: 0x7a764cc0> { URL: https://xxx.azure-mobile.net/tables/TodoItem } { status code: 200, headers {
"Cache-Control" = "no-cache";
"Content-Encoding" = gzip;
"Content-Length" = 126;
"Content-Type" = "application/json";
Date = "Sat, 22 Nov 2014 19:06:44 GMT";
Server = "Microsoft-IIS/8.0";
Vary = "Accept-Encoding";
"X-Powered-By" = "ASP.NET";
"x-zumo-version" = "Zumo.master.0.1.6.4100.Runtime";
} }, com.Microsoft.WindowsAzureMobileServices.ErrorRequestKey=<NSMutableURLRequest: 0x7a7797a0> { URL: https://xxx.azure-mobile.net/tables/TodoItem }}
有什么建议吗。我的错误:在todoitem.insert.js的insert()函数中,我从未调用request.respond()
现在node.js代码正在返回数据,但它仍然没有显示在iOS客户端中。需要更多阅读。如果您了解如何将数据返回到iOS客户端,请与他人分享!非常感谢D
var azure = require('azure-storage');
var tableSvc = azure.createTableService();
function read(query, user, request) {
query = new azure.TableQuery()
.select()
.where('PartitionKey eq ?', 'learningazure');
console.log('query: ', query);
tableSvc.queryEntities('TodoItem',query, null, function(error, result, response) {
if(!error) {
// query was successful
// add the count to the response dictionary
response.count = response.body.value.length;
response.results = result.entries;
request.respond(200, response);
} else {
console.log('Error calling read()');
console.log(error);
}
});
}