Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Troubleshoot IOException on IAsyncResult and HTTPS

Reply
Thread Tools

Troubleshoot IOException on IAsyncResult and HTTPS

 
 
Martijn van Schie
Guest
Posts: n/a
 
      03-07-2008
Hi,

I have a issue where is ever so often get an IOException:

Type : System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
Message : Unable to read data from the transport connection: The connection
was closed.
Source : System
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.IAsyncResult InternalWrite(Boolean, Byte[], Int32,
Int32, System.AsyncCallback, System.Object)

We are creating the request custom using the HttpWebRequest object and
execute the using the Page.RegisterAsyncTask.

HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(_navigationUri);

byte[] requestBytes =
System.Text.Encoding.ASCII.GetBytes(authenticateMe ssage);

request.Method = "POST";
request.ContentType = "text/xml; charset=\"utf-8\"";
request.ContentLength = requestBytes.Length;

combinedAsyncState.ProxyState = new object[] { request,
requestBytes };
return request.BeginGetRequestStream(callback, state);

The error occures only once every 10 minutes during a webtest. The trouble
is that this is very hard to debug because i cannot reproduce the error when
i want.
The party claims they have no error, nor are they responsible for the error.
Putting something like Fiddler in between to catch the request and response
message is also no option, because the requests are over HTTPS.

What is the best opproach to tackle this issue.
Regards,
Martijn

 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      03-07-2008
"Martijn van Schie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a issue where is ever so often get an IOException:

....
> The error occures only once every 10 minutes during a webtest. The trouble
> is that this is very hard to debug because i cannot reproduce the error
> when i want.
> The party claims they have no error, nor are they responsible for the
> error.
> Putting something like Fiddler in between to catch the request and
> response message is also no option, because the requests are over HTTPS.
>
> What is the best opproach to tackle this issue.


Can you try to reproduce it with HTTP?

Also, please post the entire exception, including the InnerException and
stack traces.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


 
Reply With Quote
 
 
 
 
Martijn van Schie
Guest
Posts: n/a
 
      03-10-2008
Hi John,

It's hard for me to reproduce it using HTTP, because we are using a test
WebService from a third party authorisation service.

The entire stacktrace comes to this:

Stack Trace :
at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer,
Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
size)
at TestApplication.ClientProxy.EndPostXmlMessageReque st(IAsyncResult
asyncResult)
at TestApplication.ClientProxy.EndVerifyRequest(IAsyn cResult
asyncResultRequest)
at
TestApplication.Async.AsyncVerification.EndAsyncVe rifyRequest(IAsyncResult
asyncResult)

We recently found out that a bug in .NET framework 2.0 sometimes results in
a connection closed causes by a Keep-Alive connection time out. This was
fixed in SP1.
I have asked the customer i they have installer SP1 on there production
machines.


"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
news:(E-Mail Removed)...
> "Martijn van Schie" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>>
>> I have a issue where is ever so often get an IOException:

> ...
>> The error occures only once every 10 minutes during a webtest. The
>> trouble is that this is very hard to debug because i cannot reproduce the
>> error when i want.
>> The party claims they have no error, nor are they responsible for the
>> error.
>> Putting something like Fiddler in between to catch the request and
>> response message is also no option, because the requests are over HTTPS.
>>
>> What is the best opproach to tackle this issue.

>
> Can you try to reproduce it with HTTP?
>
> Also, please post the entire exception, including the InnerException and
> stack traces.
> --
> --------------------------------------------------------------------------------
> John Saunders | MVP - Windows Server System - Connected System Developer
>
>


 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      03-10-2008
"Martijn van Schie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi John,
>
> It's hard for me to reproduce it using HTTP, because we are using a test
> WebService from a third party authorisation service.
>
> The entire stacktrace comes to this:
>
> Stack Trace :
> at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer,
> Int32 offset, Int32 size, AsyncCallback callback, Object state)
> at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
> size)
> at TestApplication.ClientProxy.EndPostXmlMessageReque st(IAsyncResult
> asyncResult)
> at TestApplication.ClientProxy.EndVerifyRequest(IAsyn cResult
> asyncResultRequest)
> at
> TestApplication.Async.AsyncVerification.EndAsyncVe rifyRequest(IAsyncResult
> asyncResult)


That's an interesting pattern of End* method calls. Can you provide an
outline of the pattern of async calling? Is EndPostXmlMessageRequest your
code? Does it explicitly call Write on the stream?

Also, in this case, it's possible that more than just the stack trace may be
interesting. Can you provide the output of ex.ToString()? That is, when you
catch the exception, run ToString on the caught exception, then post the
result. That will include all of the nested InnerException instances.

--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


 
Reply With Quote
 
Martijn van Schie
Guest
Posts: n/a
 
      03-10-2008
Hi John,

Our customer let me know today that the issue is resolved after installing
SP1.
I agree on the End* stack . The application is programmed to be very
generic and modulated, and yes, the EndPostXmlMessageRequest is ours. It's
handles the callback from a custom soap request to a webservice proxy using
the HttpWebRequest object.

One problem is that i can't reproduce the issue that easily anymore, as i
installed SP1 on both the test and development machine. I might have a stack
for you from an eventlog backup or issue tracker. I'll try to find one and
post it for you.

Thank you for your time anyways.

Regards,
Martijn


"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
news:%(E-Mail Removed)...
> "Martijn van Schie" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi John,
>>
>> It's hard for me to reproduce it using HTTP, because we are using a test
>> WebService from a third party authorisation service.
>>
>> The entire stacktrace comes to this:
>>
>> Stack Trace :
>> at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[]
>> buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>> at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
>> size)
>> at TestApplication.ClientProxy.EndPostXmlMessageReque st(IAsyncResult
>> asyncResult)
>> at TestApplication.ClientProxy.EndVerifyRequest(IAsyn cResult
>> asyncResultRequest)
>> at
>> TestApplication.Async.AsyncVerification.EndAsyncVe rifyRequest(IAsyncResult
>> asyncResult)

>
> That's an interesting pattern of End* method calls. Can you provide an
> outline of the pattern of async calling? Is EndPostXmlMessageRequest your
> code? Does it explicitly call Write on the stream?
>
> Also, in this case, it's possible that more than just the stack trace may
> be interesting. Can you provide the output of ex.ToString()? That is, when
> you catch the exception, run ToString on the caught exception, then post
> the result. That will include all of the nested InnerException instances.
>
> --
> --------------------------------------------------------------------------------
> John Saunders | MVP - Windows Server System - Connected System Developer
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IHttpAsyncHandler: Is the WaitHandle on the IAsyncResult returnedfrom BeginProcessRequest ever used by the HTTP application? UL-Tomten ASP .Net 0 12-09-2007 11:43 PM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
HTTPS connection in WTK2.2 (J2ME): "Certificate was issued by anunrecognized entity" IOException Alex Hunsley Java 0 06-28-2006 01:49 PM
ASyncResult vs. IASyncResult FefeOxy C++ 3 02-02-2006 08:23 PM
use and lifecycle of IAsyncResult object in Asynchonous Consuming of XML Web Service johnmann56 ASP .Net Web Services 0 05-24-2004 01:26 PM



Advertisments