से डेटा पुनर्प्राप्त करने का प्रयास करते समय यह विधि मैं उपयोग कर रहा हूं।मोबाइल सेवा InnvalidOperationException Azure
try
{
List<Patient> pList = await App.MobileService.GetTable<Patient>().Where(
patient => patient.id == 1).ToListAsync();
foreach (Patient p in pList)
{
System.Diagnostics.Debug.WriteLine("{0}, {1}", p.id, p.first_name);
}
}
catch (Exception err)
{
System.Diagnostics.Debug.WriteLine("ERROR! : {0}", err.Message);
}
यहां रोगी इकाई है।
class Patient
{
public int id { get; set; }
public string first_name { get; set; }
public string last_name { get; set; }
public string middle_name { get; set; }
public string nirc { get; set; }
public int bed_id { get; set; }
}
यहां मुझे मिली त्रुटि है।
An exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.WebException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.DLL and wasn't handled before a managed/native boundary
An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in Microsoft.Azure.Zumo.WindowsPhone8.Managed.DLL and wasn't handled before a managed/native boundary
An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll
An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
जब मैं एक TryCatch भीतर मेरे विधि लपेट, मैं इस संदेश को
Error : The request could not be completed. ()
यहाँ ढेर त्रुटि संदेश
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.CreateMobileServiceException(String errorMessage, IServiceFilterRequest request, IServiceFilterResponse response)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.ThrowInvalidResponse(IServiceFilterRequest request, IServiceFilterResponse response, JToken body)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.<RequestAsync>d__f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.<SendReadAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<EvaluateQueryAsync>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.MobileServices.MobileServiceTableQuery`1.<ToListAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at PhoneApp1.MainPage.<populate>d__0.MoveNext()
कुछ बिंदुओं को नोट करने के लिए मिलता है।
- अनुमति
Anybody with the Application Key
- पर सेट है मैं
Windows Azure Mobile Services Managed Client
- के संदर्भ में मैं पहले से ही App.XAML.CS. के भीतर इस कोड डाल दिया जोड़ दिया है
using Microsoft.WindowsAzure.MobileServices;
- मैंने ऐप.एक्सएएमएल.सीएस के भीतर this वेबसाइट से अधिग्रहित कोड का यह टुकड़ा पहले से ही रखा है।
public static MobileServiceClient MobileService = new MobileServiceClient(AppUrl, AppKey);
क्यों मैं अपने डेटाबेस से कनेक्ट करने में असमर्थ हूँ? मैंने इन स्टोर को विंडोज स्टोर एप्लिकेशन पर चलाने का प्रयास किया है और यह काम करता है। पहले मैंने वही काम किया है और यह भी काम करता है।
यह समस्या को हल नहीं करता है, यह इसके आसपास काम करता है। यह HTTPS को अक्षम करता है जिसका अर्थ है कि आपका डेटा अब स्पष्ट टेक्स्ट में भेजा गया है - शायद एक अच्छी बात नहीं है। मेरे मामले में डिवाइस पर दिनांक/समय गलत था जिसने HTTPS को विफल कर दिया था। –