0
votes

I'm using WebClient object in to poll some data from server. When DownloadStringCompleted performed I do error checking: e.error, where 'e' is the DownloadStringCompletedEventArgs, and if an error occurs I output the message. Everything works cool, but when I run the application on the PHONE with a running 3G I get an error "the remote server responded: not found". However, if I switch on WiFi all works. In the browser page with this url is opened and on the emulator, just everything works. And maybe this is the dumbest question ever but I really can't understand what's happening :D

What can I do to fix this?!

P.S. Sorry for my English. Bing translator help me =)

1
is this your own web server? is it behind a firewall? - Daniel A. White
This is the Web server of our company. I repeat, everything works fine if a Wifi connection, the problem is only with the mobile Internet ... and it is not always - Alexander Korolev
talk to your network administrators. ensure that that web server is accessible thru your firewall. your wifi might be inside the firewall. - Daniel A. White
with the phone browser,using the same 3G I can open the address and get information. I don't understand why the error occurs is not always. Even if I only use the 3G connection. talked to a system administrator...everything is fine with the firewall - Alexander Korolev

1 Answers

0
votes

Problem solved. It helped me

WebClient webClient = new WebClient();
                webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(clientED2_DownloadStringCompleted);
                webClient.DownloadStringAsync(new Uri("http://www.server.com"), "GET");

Instead this

WebClient webClient = new WebClient();
                    webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(clientED2_DownloadStringCompleted);
                    webClient.DownloadStringAsync(new Uri("http://www.server.com"));