Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2007

Tip: Looking for answers? Try searching our database.

Cannot access a disposed object named "System.Net.TlsStream"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
red - 25 Jan 2007 20:51 GMT
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(oCurrentWESServiceDesc.WESServiceURL);   

       
        HttpWRequest.Timeout =
Convert.ToInt32(Convert.ToInt32(oCurrentWESServiceDesc.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
Eugen - 31 Jan 2007 12:55 GMT
Hi Red,

Were you able to solve the problem?

I am looking at the code and I am trying to understand where it fails: is it
because tempStream becames a NULL object or maybe because
tempStream.Write(PostData,0,PostData.Length) is trying to write no data?

Have you tried tracing the code, writting the output to a file when the
error occurs, just to see under what condition the error happens? I
understand the application is in production but maybe you can add a flag in
the web.config and turn it on for a limited period of time just to cactch the
error. (I have read recently an article on MSDN with a firm who developed a
tool to trace the requests in a web application and figure out a Microsoft
bug which was happening once at 100.000 requests.)

I have found this while reading in the MSDN library about
HttpWebRequest.GetRequestStream method, maybe you already know it:
" In a .NET Compact Framework application, a request stream with zero
content length was not obtained and closed correctly. For more information
about handling zero content length requests:
http://msdn2.microsoft.com/en-us/library/1afx2b0f.aspx

Anyway, it will be nice to know how did you handled this issue.

Best regards,
Eugen

> Hi Friends,
>
[quoted text clipped - 55 lines]
> Regards,
> red
red - 31 Jan 2007 17:56 GMT
Hi Eugen,

Since its a production environment I am not in a position to change even a
web.config entry for a short period of time.

I will try to generate the trace with the help of someone from the Infra
team and get back to you.

Thanks again

red

> Hi Red,
>
[quoted text clipped - 83 lines]
> > Regards,
> > red

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.