我在MVVMCross的PCL項目中使用WCF Data Services 5.6。在WPF客戶端下面的代碼(在視圖模型)的作品就像一個魅力(基於在http://msdn.microsoft.com/en-us/library/dd756367(v=vs.110).aspx發現樣品):MVVMCross + Xamarin + WCF數據服務5.6 =未實現異常?
DataServiceQuery<T> query = this.LoadItemsQuery;
query.BeginExecute((result) =>
{
try
{
DataServiceQuery<T> resultQuery = result.AsyncState as DataServiceQuery<T>;
foreach (T item in resultQuery.EndExecute(result))
{
// Do something here
}
}
catch (Exception ex)
{
PublishException(ex);
}
}
, query);
但在Android客戶端,「resultQuery.EndExecute(結果)」拋出以下例外:
System.InvalidOperationException: An error occurred while processing this request. ---> System.NotImplementedException: The requested feature is not implemented.
at System.Net.WebResponse.get_SupportsHeaders() [0x00000] in <filename unknown>:0
at System.Data.Services.Client.HttpWebRequestMessage.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.ODataRequestMessageWrapper.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.DataServiceContext.GetResponseHelper (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult, Boolean handleWebException) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.DataServiceContext.EndGetResponse (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.RequestInfo.EndGetResponse (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.QueryResult.AsyncEndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Data.Services.Client.BaseAsyncResult.EndExecute[QueryResult] (System.Object source, System.String method, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.QueryResult.EndExecuteQuery[Appointment] (System.Object source, System.String method, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 }
任何想法?有人用MonoDroid測試過WCF Data Services 5.6嗎?
在此先感謝