473,378 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

HttpWebRequest.GetResponse returns 404 No Found error

I have a windows client app that is trying to download a file from
a web server but I always get the following error when I call the
GetResponse method of the Request object.

The remote server returned an error: (404) Not Found.

When I run it against a website on my local machine everything works
perfectly, but not against the remote server. I'm sure it's a security
or permissions problem of some sort, but I'm not sure where to start.

The code I'm using is below.

Thanks in advance for any help.

Cameron
HttpWebResponse Response;

//Retrieve the File
HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(url);
Request.Headers.Add("Translate: f");
Request.Credentials = CredentialCache.DefaultCredentials;

try
{
Response = (HttpWebResponse)Request.GetResponse();
}
catch(WebException e)
{
//Handle the exception here
}
finally
{
Response.Close()
}
Nov 18 '05 #1
2 5848
Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
Does the URL requested actually exist?

Cheers
Ken

"warlord" <sm*********@hotmail.com> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
: I have a windows client app that is trying to download a file from
: a web server but I always get the following error when I call the
: GetResponse method of the Request object.
:
: The remote server returned an error: (404) Not Found.
:
: When I run it against a website on my local machine everything works
: perfectly, but not against the remote server. I'm sure it's a security
: or permissions problem of some sort, but I'm not sure where to start.
:
: The code I'm using is below.
:
: Thanks in advance for any help.
:
: Cameron
:
:
: HttpWebResponse Response;
:
: //Retrieve the File
: HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(url);
: Request.Headers.Add("Translate: f");
: Request.Credentials = CredentialCache.DefaultCredentials;
:
: try
: {
: Response = (HttpWebResponse)Request.GetResponse();
: }
: catch(WebException e)
: {
: //Handle the exception here
: }
: finally
: {
: Response.Close()
: }
:
:
Nov 18 '05 #2
The web server is IIS 5.0, and the Url does exist. I can get to it via a
browser without any problems - it's just from within the windows app that it
isn't accessible.

Cheers,

Cameron

"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
Does the URL requested actually exist?

Cheers
Ken

"warlord" <sm*********@hotmail.com> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
: I have a windows client app that is trying to download a file from
: a web server but I always get the following error when I call the
: GetResponse method of the Request object.
:
: The remote server returned an error: (404) Not Found.
:
: When I run it against a website on my local machine everything works
: perfectly, but not against the remote server. I'm sure it's a security
: or permissions problem of some sort, but I'm not sure where to start.
:
: The code I'm using is below.
:
: Thanks in advance for any help.
:
: Cameron
:
:
: HttpWebResponse Response;
:
: //Retrieve the File
: HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(url);
: Request.Headers.Add("Translate: f");
: Request.Credentials = CredentialCache.DefaultCredentials;
:
: try
: {
: Response = (HttpWebResponse)Request.GetResponse();
: }
: catch(WebException e)
: {
: //Handle the exception here
: }
: finally
: {
: Response.Close()
: }
:
:

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: warlord | last post by:
I have a windows client app that is trying to download a file from a web server but I always get the following error when I call the GetResponse method of the Request object. The remote server...
10
by: warlord | last post by:
I have a windows client app that is trying to download a file from a web server but I always get the following error when I call the GetResponse method of the Request object. The remote server...
17
by: warlord | last post by:
I have a windows client app that is trying to download a file from a web server but I always get the following error when I call the GetResponse method of the Request object. The remote server...
2
by: Maris Janis Vasilevskis | last post by:
Hi, Is it possible to force HttpWebRequest to do exactly (not approximately) the same as MSXML2.ServerXMLHTTP does? More details. I port JScript to JScript.NET I have a server (ASP invoking...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.