I post this message again as I didn't get an answer back. I would appriciate
any ideas.
I am getting the following error when sending a https request after a long
period with no activity.
Cannot access a disposed object named "System.Net.TlsStream".
After that everything sems to be fine untill the next long idle period. The
code is below.
Encoding oEnc = System.Text.Encoding.GetEncoding(1252);
oNc = new NetworkCredential(cUserName, cPassWord);
oWebReq = (HttpWebRequest) WebRequest.Create("https://...");
oWebReq.Timeout = 30000;
oWebReq.ContentType = "text/xml";
oWebReq.Method = "POST";
oWebReq.ContentLength = bBuffer.Length;
// -- request ---
oPostStream = oWebReq.GetRequestStream();
oPostStream.Write(bBuffer,0,bBuffer.Length);
oPostStream.Close();
// -- response ---
oWebRes = (HttpWebResponse) oWebReq.GetResponse();
oResStream = new StreamReader(oWebRes.GetResponseStream(),oEnc);
cRes = oResStream.ReadToEnd();