Hi there,
try to download some XML files from an HTTP server.
I got developed that code here inside Visual Studio 2017:
public string testURLR() { try { WebRequest request = WebRequest.Create("http://www.domain.com:123/weatherdata.xml"); request.Credentials = CredentialCache.DefaultCredentials; // Get the response. WebResponse response = request.GetResponse(); Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); reader.Close(); response.Close(); return responseFromServer; } catch (Exception e) { return e.ToString(); } }
However, the method GetResponse throws an Exception: "System.Net.WebException: Cannot resolve host name."
My watch R805 is connect through Wifi and got proper IP, Netmask, Gateway and DNS information definitely.
Is there some special preparations on the routing?
Btw, as the server to be accessed can also addressed by a fixed IP address (So no DNS resolving required), then the error message will be "Couldn't connect to server" which tells me the application has some network access restriction (by TizenOS??)
Any idea how to overcome this? Any special access right required or configurations?
Thanks!