views:

2012

answers:

3

Hello, i m creating mobile application for windows mobile 6.i m uploading an image on url/website. for this i m using webrequest and webresponse class.at the time of getting response i m getting this type of error-

The remote name could not be resolved.. my code is- String url = "http://weblogs.asp.net/scottgu/rss.aspx"; System.Net.WebRequest request = System.Net.WebRequest.Create(url); request.Credentials = System.Net.CredentialCache.DefaultCredentials;

        System.Net.WebResponse response = null;
        System.IO.Stream stream = null;
        response = request.GetResponse();
        stream = response.GetResponseStream();

any one can help me.. thx in Advance... Regards Pankaj Pareek

A: 

This means that while processing the URL for the web server, the underlying network connection was unable to convert the name into an IP address. The two most likely reasons this could be happening are

  1. You introduced a typo into the URL you put into the application
  2. You are currently experiencing a DNS issue on your network

The quickest way to verify this is to try and pull up the web site in the mobile browser. If you can't pull it up it's likely a DNS issue.

JaredPar
A: 

While I don't have specific experience with Windows Mobile this error message generally indicates a failure to resolve a hostname to an IP address. This can happen for a number of reasins including:

  • The client can not contact the DNS server to attempt to resolve the name. This suggests a lack of network and/or internet connectivity
  • The DNS query did not yeild a result.

Resolution Suggestions:

  1. Check that the name is correctly specified
  2. Verify that there is network connectivity as this is required to communicate with the DNS server(s) used to resolve a hostname
  3. Check that the DNS server address is correct especially if they are configured staticlly.

Hope this helps

Crippledsmurf
A: 

My number one suggestion to you is to try it in the browser on the device. If it works on the browser then it should work in your code. If it doesn't then it's a setup issue on your device OR if you are connected by ActiveSync, it may be a network issue on your host machine (like a firewall).

Also note that your code will NOT automatically create a cellular network connection. You are to the Connection Manager to request it before doing your web requests.

Shane Powell
Are you sure about that? I believe that WebRequest will create a connection manager connection if there isn't one
Matt
In the WinCE API it is the case, so in a C/C++ compiled app you would ahve to. In C# .net app I have no idea. So you may be correct about that.
Shane Powell