Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 .NET3.5 ASP.NET .NET C#4.0 , +
Hi,
 
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.
 

 
Thanks,
 
Hanumant
Posted 18-Jun-13 21:49pm
Rate this: bad
good
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...
  Permalink  
Rate this: bad
good
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.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have a look at this one..it looks similar..
the-remote-server-returned-error-504[^]
  Permalink  

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

  Print Answers RSS
0 CHill60 210
1 Sergey Alexandrovich Kryukov 200
2 Peter Leow 180
3 Zoltán Zörgő 175
4 Richard Deeming 166
0 Sergey Alexandrovich Kryukov 9,278
1 OriginalGriff 6,806
2 Peter Leow 4,432
3 Zoltán Zörgő 3,944
4 Richard MacCutchan 2,782


Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 30 Dec 2014
Copyright © CodeProject, 1999-2015
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