473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

Hi all

I have the following piece of code for retrieving some info from an
external url. I receive an error - "The operation has timed-out" at
GetResponse() line. I have tried extending the time out duration. I
dont have any SETI etc on my computer. Anything wrong in code? how can
i resolve my issue?

Any insight highly appreciated..
thanks
laks..

------------------------------------------

strXmlRequest = "Something in xml";

XmlDocument xmlDoc;
xmlDoc = new XmlDocument();
xmlDoc.LoadXml(strXmlRequest);

// Create an HTTP request to do a POST
System.Net.HttpWebRequest xmlHttpRequest = (HttpWebRequest)
WebRequest.Create("http://www.somesite.com/ExtInterface/ListingSearch.asp");xmlHttpRequest.Method="POST";

// Write the serialized XML to the request.
XmlTextWriter xmlWriter = new
XmlTextWriter(xmlHttpRequest.GetRequestStream(),
Encoding.GetEncoding("UTF-8"));
xmlDoc.WriteTo(xmlWriter);

// Force the XML text writer to finish
xmlWriter.Flush();

// Get the response from the server
System.Net.HttpWebResponse xmlHttpResponse = (HttpWebResponse)

xmlHttpRequest.GetResponse();

// Parse the response into a new XmlDocument and return it.
XmlDocument respDoc = new XmlDocument();
respDoc.Load(xmlHttpResponse.GetResponseStream());
xmlHttpResponse.Close();
------------------------------------------------

Nov 12 '05 #1
1 13112
insert line xmlWriter.Close() after the flush stmt. That fixed the
isue.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hlabbott | last post by:
Hi I'm having a problem displaying attachments correctly. I have messages with attachments stored on Exchange2000 and want to be able to click a hyperlink in my project like in OWA and see an...
5
by: Nathan | last post by:
This is a copy of a message at microsoft.public.dotnet.framework.clr: THE CODE: I'm using an HttpWebResponse object to send an HTTP POST to a Java server I have written and are running on the...
1
by: Jeff B | last post by:
I'm trying to create a simple screen scraping application and I kept getting a System.Net.WebException thrown back with a message of "The operation has timed-out." At first I thought it was some...
0
by: Matt | last post by:
(can't find any of my previous post for same issue. please CC to my email address as well. Thanks!) Hi all, What is the possible reason that HttpWebRequest.GetRequestStream() may hang there...
2
by: Noggin The Nog | last post by:
Hi all, I've been trying to get HttpWebResponse to work, but whenever I try I get "The operation has timed-out". I'm simply trying to send an HTTP request querystring to a remote website and read...
3
by: Taner Özyürekoglu | last post by:
I have an error below. is there any idea about it. Dim Req As HttpWebRequest = WebRequest.Create("https://certification.authorize.net/gateway/transact.dll?" & postdata) Response.Write("3")...
8
by: Morgan Cheng | last post by:
I happens to surf to http://www.codeproject.com/cs/internet/Crawler.asp, which claims that WebRequest.GetResponse() will block other thread calling this function until WebResponse.Close() is...
0
by: Tom | last post by:
Hi, Could someone please help me with this I am trying to do use the following code to post a form and get response but it 's keep giving me a error "The operation has timed-out." on this line...
4
by: Mahernoz | last post by:
Hi Friends, I have this code in a C# console application which calls a URL on my website(Asp.net/C#) with Querystrings. (I have also tried without querystrings). The problem is my program...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.