Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.3.0
-
Development Environment: Visual Studio 2012 (with Update 4), Windows 8.1 Pro x64, Target Environment: Windows Phone 8.0, Other libraries - jquery
Description
I need jquery/ajax to ping SAP-Server.
I get the following exceptions:
System.InvalidOperationException occured of type "System.ni.dll"
Exception of Type System.InvalidOperationException in Microsoft.Phone.Interop.ni.dll
In these cases I received a 404 error.
Value of commandSt was changed during debugging.
commandStr: "XHRLOCAL/Http://sapfd1.flexus.net:8030/sap/public/ping?=1362547834285"
or
commandStr: "XHRLOCAL/Http://sapfd1.flexus.net:8030/sap/public/ping"
function checkPublicPing() { var successful = false; var publicPingPath = "sap/public/ping"; var serverURI = "http://sapfd1.flexus.net:8030"; $.ajax({ async : false, url : serverURI + publicPingPath, cache : false }).fail(function(error) { successful = false; }).done(function(data, textStatus, xhr) { successful = true; }); return successful; }
public bool HandleCommand(string commandStr) { //commandStr: "XHRLOCAL/Http:/sapfd1.flexus.net:8030/sap/public/ping?_=1362547834285" if (commandStr.IndexOf("XHRLOCAL") == 0) { string url = commandStr.Replace("XHRLOCAL/", ""); // url: {Http:/sapfd1.flexus.net:8030/sap/public/ping?_=1362547834285} Uri uri = new Uri(url, UriKind.RelativeOrAbsolute); // uri: {Http:/sapfd1.flexus.net:8030/sap/public/ping?_=1362547834285} using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) { if (isoFile.FileExists(uri.AbsolutePath)) { //uri.AbsolutePath: InvalidOperationException Typ "Sytem.ni.dll" using (TextReader reader = new StreamReader(isoFile.OpenFile(uri.AbsolutePath, FileMode.Open, FileAccess.Read))) { string text = reader.ReadToEnd(); Browser.InvokeScript("__onXHRLocalCallback", new string[] { "200", text }); return true; } } }
Please advise.