HttpWebRequest.GetResponse returns 404 No Found error

Discussion in 'ASP .Net Security' started by warlord, Apr 1, 2004.

  1. warlord

    warlord Guest

    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()
    }
    warlord, Apr 1, 2004
    #1
    1. Advertising

  2. warlord

    Ken Schaefer Guest

    Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    Does the URL requested actually exist?

    Cheers
    Ken

    "warlord" <> wrote in message
    news:...
    : 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()
    : }
    :
    :
    Ken Schaefer, Apr 1, 2004
    #2
    1. Advertising

  3. warlord

    warlord Guest

    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" <> wrote in message
    news:...
    > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > Does the URL requested actually exist?
    >
    > Cheers
    > Ken
    >
    > "warlord" <> wrote in message
    > news:...
    > : 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()
    > : }
    > :
    > :
    >
    >
    warlord, Apr 1, 2004
    #3
  4. Could it be that you go through a proxy server normally, and your windows
    app is not providing the proxy credentials?

    --
    Regards

    John Timney
    Microsoft Regional Director
    Microsoft MVP


    "warlord" <> wrote in message
    news:e$...
    > 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" <> wrote in message
    > news:...
    > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > Does the URL requested actually exist?
    > >
    > > Cheers
    > > Ken
    > >
    > > "warlord" <> wrote in message
    > > news:...
    > > : 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()
    > > : }
    > > :
    > > :
    > >
    > >

    >
    >
    John Timney \(Microsoft MVP\), Apr 1, 2004
    #4
  5. The browser reports the HTTP_REFERRER to the server.
    And a lot of servers prevent downloading images if HTTP_REFERRER points to
    different server name.

    Thus preventing so called "hotlinking". When someone else site links to the
    images that reside on someone else's server.

    So they do not need to pay for bandwidth.

    George.


    "warlord" <> wrote in message
    news:...
    > 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()
    > }
    >
    >
    George Ter-Saakov, Apr 1, 2004
    #5
  6. warlord

    warlord Guest

    I thought that might be the case, but I'm providing the proxy credentials
    and still no joy. In fact, I get the same error whether I provide them or
    not, and when I run everything locally it works whether I provide the proxy
    credntials or not.

    Regards,

    Cameron

    "John Timney (Microsoft MVP)" <> wrote in message
    news:...
    > Could it be that you go through a proxy server normally, and your windows
    > app is not providing the proxy credentials?
    >
    > --
    > Regards
    >
    > John Timney
    > Microsoft Regional Director
    > Microsoft MVP
    >
    >
    > "warlord" <> wrote in message
    > news:e$...
    > > 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" <> wrote in message
    > > news:...
    > > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > > Does the URL requested actually exist?
    > > >
    > > > Cheers
    > > > Ken
    > > >
    > > > "warlord" <> wrote in message
    > > > news:...
    > > > : 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()
    > > > : }
    > > > :
    > > > :
    > > >
    > > >

    > >
    > >

    >
    >
    warlord, Apr 2, 2004
    #6
  7. warlord

    warlord Guest

    I probably should add that the same windows application calls a web service
    one the server without any problems - it's only trying to get the Response
    stream from a new Request object.

    Cheers,

    Cameron

    "John Timney (Microsoft MVP)" <> wrote in message
    news:...
    > Could it be that you go through a proxy server normally, and your windows
    > app is not providing the proxy credentials?
    >
    > --
    > Regards
    >
    > John Timney
    > Microsoft Regional Director
    > Microsoft MVP
    >
    >
    > "warlord" <> wrote in message
    > news:e$...
    > > 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" <> wrote in message
    > > news:...
    > > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > > Does the URL requested actually exist?
    > > >
    > > > Cheers
    > > > Ken
    > > >
    > > > "warlord" <> wrote in message
    > > > news:...
    > > > : 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()
    > > > : }
    > > > :
    > > > :
    > > >
    > > >

    > >
    > >

    >
    >
    warlord, Apr 2, 2004
    #7
  8. Does the app your calling expect cookies, I'm guessing that your web service
    is stateless but your web app is not. It may be trying to establish a
    session and failing.

    --
    Regards

    John Timney
    Microsoft Regional Director
    Microsoft MVP


    "warlord" <> wrote in message
    news:...
    > I probably should add that the same windows application calls a web

    service
    > one the server without any problems - it's only trying to get the Response
    > stream from a new Request object.
    >
    > Cheers,
    >
    > Cameron
    >
    > "John Timney (Microsoft MVP)" <> wrote in message
    > news:...
    > > Could it be that you go through a proxy server normally, and your

    windows
    > > app is not providing the proxy credentials?
    > >
    > > --
    > > Regards
    > >
    > > John Timney
    > > Microsoft Regional Director
    > > Microsoft MVP
    > >
    > >
    > > "warlord" <> wrote in message
    > > news:e$...
    > > > 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" <> wrote in message
    > > > news:...
    > > > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > > > Does the URL requested actually exist?
    > > > >
    > > > > Cheers
    > > > > Ken
    > > > >
    > > > > "warlord" <> wrote in message
    > > > > news:...
    > > > > : 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()
    > > > > : }
    > > > > :
    > > > > :
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    John Timney \(Microsoft MVP\), Apr 2, 2004
    #8
  9. warlord

    warlord Guest

    John,
    The web service is actually using session state (I'm not entirely sure why
    as I didn't write the service...in fact I didn't write any of it, I'm just
    the luck SOB who got the job of debugging it and finishing it off) and of
    course the web application is also using session state.

    I have even added a separate web.config file to the folder containing the
    files I'm trying to get to that explicitly sets the session state settings
    (not that I need to do that) but also overrides the authenticaton and
    authorization settings to use Windows authentication (impersonate is set to
    true) and to allow all users - all to no avail.

    Interestingly, if I disable session state for the web application the home
    page still displays as it is not reliant on session at all, but when I
    navigate to a page that uses session state the error I receive is the 404 -
    Not Found error. Your previous reply and this is what prompted me to try
    the separate config files.

    I've also set the cookieless element of the sessionState setting to true but
    that too makes no difference.

    Any further suggestions ?

    Thanks for all your help so far.

    Regards,

    Cameron Gibbs


    "John Timney (Microsoft MVP)" <> wrote in message
    news:...
    > Does the app your calling expect cookies, I'm guessing that your web

    service
    > is stateless but your web app is not. It may be trying to establish a
    > session and failing.
    >
    > --
    > Regards
    >
    > John Timney
    > Microsoft Regional Director
    > Microsoft MVP
    >
    >
    > "warlord" <> wrote in message
    > news:...
    > > I probably should add that the same windows application calls a web

    > service
    > > one the server without any problems - it's only trying to get the

    Response
    > > stream from a new Request object.
    > >
    > > Cheers,
    > >
    > > Cameron
    > >
    > > "John Timney (Microsoft MVP)" <> wrote in message
    > > news:...
    > > > Could it be that you go through a proxy server normally, and your

    > windows
    > > > app is not providing the proxy credentials?
    > > >
    > > > --
    > > > Regards
    > > >
    > > > John Timney
    > > > Microsoft Regional Director
    > > > Microsoft MVP
    > > >
    > > >
    > > > "warlord" <> wrote in message
    > > > news:e$...
    > > > > 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" <> wrote in message
    > > > > news:...
    > > > > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > > > > Does the URL requested actually exist?
    > > > > >
    > > > > > Cheers
    > > > > > Ken
    > > > > >
    > > > > > "warlord" <> wrote in message
    > > > > > news:...
    > > > > > : 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()
    > > > > > : }
    > > > > > :
    > > > > > :
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    warlord, Apr 6, 2004
    #9
  10. > The web service is actually using session state (I'm not entirely sure why
    > as I didn't write the service...in fact I didn't write any of it, I'm just
    > the luck SOB who got the job of debugging it and finishing it off) and of
    > course the web application is also using session state.



    if thats the case, then your winforms app needs to handle the cookie asp.net
    generates when you connect to the server. The server will expect the
    session cookie to be passed back to it.


    --
    Regards

    John Timney
    Microsoft Regional Director
    Microsoft MVP
    John Timney \(Microsoft MVP\), Apr 6, 2004
    #10
  11. warlord

    warlord Guest

    Have you got any examples of doing this ? I've set the
    Request.CookieContainer to a new CookieContainer before calling
    Request.GetResponse but the same error occurs. You mention the app needs to
    handle the cookie that asp.net generates when it connects to the server, but
    I don't seem to be able to connect to the server without getting the error.

    Regards,

    Cameron Gibbs

    "John Timney (Microsoft MVP)" <> wrote in message
    news:...
    > > The web service is actually using session state (I'm not entirely sure

    why
    > > as I didn't write the service...in fact I didn't write any of it, I'm

    just
    > > the luck SOB who got the job of debugging it and finishing it off) and

    of
    > > course the web application is also using session state.

    >
    >
    > if thats the case, then your winforms app needs to handle the cookie

    asp.net
    > generates when you connect to the server. The server will expect the
    > session cookie to be passed back to it.
    >
    >
    > --
    > Regards
    >
    > John Timney
    > Microsoft Regional Director
    > Microsoft MVP
    >
    >
    >
    >
    warlord, Apr 8, 2004
    #11
  12. warlord

    warlord Guest

    Well I've almost got to the bottom of the problem....The IIS Lockdown
    utitlity had been run on the server (which I was not made aware of) and
    there were two things preventing my app from working correctly.

    Firstly the UrlScan utitlity was preventing the request from getting
    through, hence the 404 Not Found error. Exactly what changes I need to make
    to the UrlScan INI file I'm not yet sure, but at least I know the root of
    the problem lies there.

    Secondly, WebDAV had been disabled. This wasn't the cause of the 404 Not
    Found error, but still needed enabling anyway. With this disabled (and
    UrlScan not running at all) I got a 501 Not Implemented error.

    So thanks to Ken pointing me in theright direction, WebDAV is now enabled.
    All I have to do now is figure out the changes to UrlScan

    Cheers,

    Cameron

    "warlord" <> wrote in message
    news:e$...
    > 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" <> wrote in message
    > news:...
    > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > Does the URL requested actually exist?
    > >
    > > Cheers
    > > Ken
    > >
    > > "warlord" <> wrote in message
    > > news:...
    > > : 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()
    > > : }
    > > :
    > > :
    > >
    > >

    >
    >
    warlord, Apr 20, 2004
    #12
  13. warlord

    warlord Guest

    I figured out that the 'translate' header must be allowed through UrlScan,
    and also the PROPFIND verb. My UrlScan configuration was denying both of
    these and was the root of the problem.


    Cameron

    "warlord" <> wrote in message
    news:...
    > Well I've almost got to the bottom of the problem....The IIS Lockdown
    > utitlity had been run on the server (which I was not made aware of) and
    > there were two things preventing my app from working correctly.
    >
    > Firstly the UrlScan utitlity was preventing the request from getting
    > through, hence the 404 Not Found error. Exactly what changes I need to

    make
    > to the UrlScan INI file I'm not yet sure, but at least I know the root of
    > the problem lies there.
    >
    > Secondly, WebDAV had been disabled. This wasn't the cause of the 404 Not
    > Found error, but still needed enabling anyway. With this disabled (and
    > UrlScan not running at all) I got a 501 Not Implemented error.
    >
    > So thanks to Ken pointing me in theright direction, WebDAV is now enabled.
    > All I have to do now is figure out the changes to UrlScan
    >
    > Cheers,
    >
    > Cameron
    >
    > "warlord" <> wrote in message
    > news:e$...
    > > 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" <> wrote in message
    > > news:...
    > > > Is the remote server an IIS 6.0 box? If so, is WebDAV enabled?
    > > > Does the URL requested actually exist?
    > > >
    > > > Cheers
    > > > Ken
    > > >
    > > > "warlord" <> wrote in message
    > > > news:...
    > > > : 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()
    > > > : }
    > > > :
    > > > :
    > > >
    > > >

    > >
    > >

    >
    >
    warlord, Apr 21, 2004
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff B
    Replies:
    1
    Views:
    13,150
    Rick Strahl [MVP]
    Dec 20, 2003
  2. warlord
    Replies:
    12
    Views:
    10,505
    warlord
    Apr 21, 2004
  3. GlennLanier
    Replies:
    2
    Views:
    21,273
    GlennLanier
    Jun 10, 2005
  4. Replies:
    2
    Views:
    647
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Dec 2, 2006
  5. warlord

    HttpWebRequest.GetResponse returns 404 No Found error

    warlord, Apr 1, 2004, in forum: ASP .Net Web Services
    Replies:
    12
    Views:
    274
    warlord
    Apr 21, 2004
Loading...

Share This Page