Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. HttpWebResponse.GetResponse(); The operation has timed-out

HttpWebResponse.GetResponse(); The operation has timed-out

Scheduled Pinned Locked Moved ASP.NET
xmltutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    livez
    wrote on last edited by
    #1

    Hello! We run this code to get xml for an example from uri´s try { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUriString); webRequest.Timeout = timeOut; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); return new StreamReader(webResponse.GetResponseStream(), encoding); } catch(WebException e) { LogError(e); return null; } We keep getting alot of "The operation has timed-out"-exceptions thrown. Is there something we are missing when we are setting up the webRequest object? For instance, should we set ReadWriteTimeout? /regards W

    S A 2 Replies Last reply
    0
    • L livez

      Hello! We run this code to get xml for an example from uri´s try { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUriString); webRequest.Timeout = timeOut; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); return new StreamReader(webResponse.GetResponseStream(), encoding); } catch(WebException e) { LogError(e); return null; } We keep getting alot of "The operation has timed-out"-exceptions thrown. Is there something we are missing when we are setting up the webRequest object? For instance, should we set ReadWriteTimeout? /regards W

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      You Are not getting the request from the site.It Will wait for some time. if it is not recieving the request for particular time it will throw this error. Check the link it May Help http://www.codeproject.com/Messages/3208439/Re-Post-an-HTTP-Request-from-one-WebServer-to-anot.aspx[^]

      If It Helps Click It as Answer

      1 Reply Last reply
      0
      • L livez

        Hello! We run this code to get xml for an example from uri´s try { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUriString); webRequest.Timeout = timeOut; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); return new StreamReader(webResponse.GetResponseStream(), encoding); } catch(WebException e) { LogError(e); return null; } We keep getting alot of "The operation has timed-out"-exceptions thrown. Is there something we are missing when we are setting up the webRequest object? For instance, should we set ReadWriteTimeout? /regards W

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Where you mentioned webRequest.Method Other than that the code seems to be alright. If still errors out, open a web browser, paste the requestUriString to the address bar and see if the page response is within the Timeout limit... :) Cheers:rose:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        L 1 Reply Last reply
        0
        • A Abhishek Sur

          Where you mentioned webRequest.Method Other than that the code seems to be alright. If still errors out, open a web browser, paste the requestUriString to the address bar and see if the page response is within the Timeout limit... :) Cheers:rose:

          Abhishek Sur


          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

          **Don't forget to click "Good Answer" if you like to.

          L Offline
          L Offline
          livez
          wrote on last edited by
          #4

          Thank you both for your responses! I will try your suggestions.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups