Hi Friends,
We recently deployed our application to production and I am experiencing the
below error message.
Cannot access a disposed object named "System.Net.TlsStream"
The error occurs when we are making a web service call to an external system
(within our corporate n/w). The method is POST and the URL is over HTTPS.
The error is very intermittent and and the impact is not serious. However,
this issue has reached maximum visibility and I am under extreme pressure to
have it resolved as soon as possible.
I checked the KB article : http://support.microsoft.com/kb/884537/ and found
that it could be a know issue with .net 1.1. and that we have a patch to fix
the same.
I read another article http://support.microsoft.com/kb/824721/en-us on the
window server 2003 sp 1 list of updates and find a reference to the above
issue as one of the fixes.
I then checked all our servers and found that they run on windows 2003
server with SP 1. I also double confirmed by checking the version of mscorlib
dll and found it is 1.1.4322.2300. This would mean that the above error
should be handled by windows 2003 sp1. But the error still occurs. The error
is only in our production environment and has never occured in our test and
staging environment.
Below is the code where we make the webservice call.
HttpWebRequest HttpWRequest =
(HttpWebRequest)WebRequest.Create(oCurrentWESServi ceDesc.WESServiceURL);
HttpWRequest.Timeout =
Convert.ToInt32(Convert.ToInt32(oCurrentWESService Desc.MaxTimeout)*1000);
HttpWRequest.Method = "POST";
byte[] PostData = System.Text.Encoding.UTF8.GetBytes
(WrappedEIAInputXML.InnerXml);
HttpWRequest.ContentLength = PostData.Length;
Stream tempStream = HttpWRequest.GetRequestStream();
tempStream.Write(PostData,0,PostData.Length);
tempStream.Close();
if(null != HttpWResponse)
{
HttpWResponse.Close(); // close any previous connection
HttpWResponse = null; // clear the object.
}
HttpWResponse = (HttpWebResponse)HttpWRequest.GetResponse();
I really need some help in resolving this issue ASAP. Thank you very in
advance!
Regards,
red