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();
------------------------------------------------