0
我试图访问我的Azure数据库中的表并且代码正常(我相信如此或似乎)但试图从表中检索表数据服务器,它返回一个“404码”有一个例外:Android Azure:404尝试从服务器检索数据时出错
java.util.concurrent.ExecutionException: com.microsoft.windowsazure.mobileservices.MobileServiceException: {'code': 404}
这里是我的代码:
if (isInternetConnected == true) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
//ActivityContent is the column I'm trying to retrieve from
final MobileServiceList<ActivityTable> result = mToDoTable.select("ActivityContent").execute().get();
runOnUiThread(new Runnable() {
@Override
public void run() {
for (ActivityTable item : result) {
Toast.makeText(getBaseContext(), item.getActivity(), Toast.LENGTH_LONG).show();
}
}
});
} catch (Exception exception) {
Log.d("AZURE_Error", exception.toString());
Toast.makeText(getBaseContext(), exception.toString(), Toast.LENGTH_LONG).show();
}
return null;
}
}.execute();
}
我开始确保服务本身正在工作。创建一个自定义API(https://msdn.microsoft.com/en-us/library/azure/dn280974.aspx,如果您使用的是后端),它只是返回一个字符串响应(无数据库),并且是一个操作大家。尝试使用浏览器,Postman(Chrome REST客户端)等来查看是否获得响应。 – MikeWo 2015-02-24 13:58:13