HttpWebRequest and then... nothing

Hi,

I have a C# application that retrieves and sends data to a rails based webservice, using HttpWebRequest.

Code Snippet
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resourceStream = response.GetResponseStream();

XmlDocument document = new XmlDocument();
document.XmlResolver = null;
document.Load(resourceStream);

IXuiDataStructure data = Document.Document.LoadString(document.OuterXml);

resourceStream.Close();
resourceStream.Dispose();
response.Close();

Sometimes it seems like the request is not sent but it's expecting an answer.

I have used etheral to log the traffic from the application and I don't see the request going out, but after a couple of minutes I get a timeout from HttpWebRequest.

It get's even stranger, when I use TcpTunnelGui (a SOAP utility from apache) to monitor the traffic, it works perfectly; no timeouts and all requests are sent (through the tunnel).

Does anybody have a clue what might be going on here?
Could it be a network problem, proxy, policies on the domain or am I not using HttpWebRequest correctly?

Thanks,

[1369 byte] By [shaglund] at [2008-1-9]

.NET Development

Site Classified