Click here to Skip to main content
13,043,865 members (45,936 online)
Rate this:
Please Sign up or sign in to vote.

I want to access data from network machine. For it, I am using WebClient.DownloadData() method which takes parameter as URL of Document and credentials. If I executes code which contains the WebClient.DownloadData() method through IIS server it shows exception as "System.Net.WebException: The remote server returned an error: (504) Gateway Timeout. at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadData(Uri address)".

But if I runs the same code using windows application by passing same parameters then it executes properly. Even If run same code through ISS server on a local machine(if we access data from same machine) then it executes properly.

If anyone have any idea about how to resolve it then please let me know.

Thanks in advance.


Posted 18-Jun-13 20:49pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hi learner'sbug,

I have tried the given information in the blog. but its not working for me. I am getting block due to this error. Please help me...
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Have a look at this looks similar..
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Its cause due to some below points :-

"Operation Timed Out" means that YOUR program sending the request has timed out waiting for a response. This could mean:

Bad internet connection (if they are all throwing this error then this is likely).
Bad host connection (whomever you are connecting to has a problem).
Bad DNS (if the host is domain name this could be a culprit).
Bad host agent (something on the host end is not responding properly).
In these cases I would manually test connections to the affected host and resolve these issues in that manner. Try testing your own connection first, and other hosts. If the problem is a specific host then they may have issues you need to contact them about.

When you get the "504 - Gateway Timeout" it means that YOUR program did successfully connect to the host, but something went wrong on the host end and it could not return a desired response. This is not a connection problem, but a problem in either the request or the host itself. It could be that the host got stuck in an infinite loop trying to process your request, or is simply "hung", and the agent processing your request gave up and sent your request back.

In these cases I would be looking at the host, maybe running test requests that the host will accept. If the host is not within your control then contact whomever it is and report the error.

So - in short. The first timeout is likely connection related, while the 504 timeout is likely the host processing. Hope this helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 30 Dec 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100