Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i written a web service which contains function to deploy doc or aspx page to pdf.

when it runs it showing an error

System.Net.WebException: The operation has timed out
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadData(Uri address)


When i pass url to function above error shows.

but when i pass hard drive doc file above error will not shows

C#
System.Net.WebClient myClient = new WebClient();
            myClient.Credentials = adminCredentials;
            byte[] requestHTML;
            requestHTML = myClient.DownloadData(fileUrl);
            myPageHTML = utf8.GetString(requestHTML);
            myClient.Dispose();
Posted
Updated 15-Feb-15 18:30pm
v2
Comments
Subramanyam Shankar 6-Mar-15 6:49am    
The right question to ask here would be why there is a time out. Please try debugging and finding the root cause of the time out or try increasing the time out of the service.If it still persists then find the root cause and fix it. You will not get the time out scenario when you use local file.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900