Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy NotFound error occur in REST services with windows Phone app?
    text
    copied!<p>i tried to connect REST web servie from windows phone 8 application.</p> <p>it was working proberly for weeks but after no change in it I get this generic error :</p> <blockquote> <p>System.Net.WebException: The remote server returned an error: NotFound.</p> </blockquote> <p>i tried to test it by online REST Clients and services works properly</p> <p>i tried to handle Exception and parse it as webException by this code :</p> <pre><code> var we = ex.InnerException as WebException; if (we != null) { var resp = we.Response as HttpWebResponse; response.StatusCode = resp.StatusCode; </code></pre> <p>and i get no more information and final response code is : "NotFound"</p> <p>any one have any idea about what may cause this error?</p> <p>there is already a trusted Certificate implemented on the server . the one who has the server suggested to have a DNS entry for the server, this entry should be at the customer DNS or in the phone hosts file .that what i done and worked for awhile but now it doesn't work however i checked that there is no thing changed</p> <p>this is sample for Get Request it works proberly on Windwos Store apps : </p> <pre><code>async Task&lt;object&gt; GetHttps(string uri, string parRequest, Type returnType, params string[] parameters) { try { string strRequest = ConstructRequest(parRequest, parameters); string encodedRequest = HttpUtility.UrlEncode(strRequest); string requestURL = BackEndURL + uri + encodedRequest; HttpWebRequest request = HttpWebRequest.Create(new Uri(requestURL, UriKind.Absolute)) as HttpWebRequest; request.Headers["applicationName"] = AppName; request.Headers["applicationPassword"] = AppPassword; if (AppVersion &gt; 1) request.Headers["applicationVersion"] = AppVersion.ToString(); request.Method = "GET"; request.CookieContainer = cookieContainer; var factory = new TaskFactory(); var getResponseTask = factory.FromAsync&lt;WebResponse&gt;(request.BeginGetResponse, request.EndGetResponse, null); HttpWebResponse response = await getResponseTask as HttpWebResponse; // string s = response.GetResponseStream().ToString(); if (response.StatusCode == HttpStatusCode.OK) { XmlSerializer serializer = new XmlSerializer(returnType); object obj = serializer.Deserialize(response.GetResponseStream()); return obj; } else { var Instance = Activator.CreateInstance(returnType); (Instance as ResponseBase).NetworkError = true; (Instance as ResponseBase).StatusCode = response.StatusCode; return Instance; } } catch (Exception ex) { return HandleException(ex, returnType); } } </code></pre> <p>i tried to monitor connections from Emulator and i found this error in connection :</p> <p>**</p> <blockquote> <p>Authentication failed because the remote party has closed the transport stream.</p> </blockquote> <p>**</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload