Groups | Blog | Home
all groups > dotnet web services enhancements > june 2004 >

dotnet web services enhancements : TimeOut - ThreadAbortException



darren NO[at]SPAM prairiefyre.com
6/23/2004 2:18:24 PM
I'm getting an Unhandled Exception from WSE2 and I know it's related
to a timeout problem but I'm not sure where to set the timeout expiry.

Essentially if you take the Sample project "Microsoft
WSE\v2.0\Samples\CS\QuickStart\TcpStockSoapReceiver" in the
StockServiceRequestReceiver.cs class and Sleep for over 2 minutes,
before the response is sent back you will get a threadAbort exception.

e.g. Add System.Threading.Thread.Sleep(new TimeSpan(0,2,15)); around
line 80;

The exception is as follows:

Unhandled Exception: System.Exception: WSE104: An asynchronous
callback raised a
n exception. ---> System.Threading.ThreadAbortException: Thread was
being aborte
d.
at Microsoft.Web.Services2.Messaging.SoapReceiver.ProcessMessage(SoapEnvelope
message)
at Microsoft.Web.Services2.Messaging.SoapReceivers.OnReceiveComplete(IAsyncRe
sult ar)
at Microsoft.Web.Services2.AsyncResult.Complete(Boolean
completedSynchronousl
y, Exception exception)
--- End of inner exception stack trace ---
at Microsoft.Web.Services2.AsyncResult.RaiseUnhandledException(Object
o)


Thanks,
ByronKim
6/23/2004 11:37:07 PM
Please check the event log and will see the detailed error, like "'Failed to
dispatch".

thanks
Byron KIM
[quoted text, click to view]

darren NO[at]SPAM prairiefyre.com
6/24/2004 5:23:11 AM
Hi Byron,
Thanks for responding, I get nothing in the event log. Is there a way
to extend the timeout for the SoapReceiver?

Darren


[quoted text, click to view]
Sidd
6/24/2004 4:56:50 PM
Hi Darren,

There in total 4 timeout values that you need to watch for when
designing your scenario:
1. Execution Timeout
2. Idle Timeout
3. Send Timeout
4. Receive Timeout

What is most likely happening here is that on your server, since you are
sleeping for a little over 2 minutes,
your execution timeout at the server is being triggrered, hence you get
the Thread Abort exception. Once the execution timeout
is reached, the WSE framework will kill the thread that is currently
processing the particular request, to provide some safeguard
against someone who is continuously sending data for a very very long
time.

I actually inserted this line of code in the sample you mention, and
after increasing the execution timeout at the server side, I was
able to receive the request fine, without any exceptions happening.

To change the execution timeout at the server, edit your config file and
insert the following:

<microsoft.web.services2>
<messaging>
<executionTimeout value="180" /> // denotes 180
seconds
</messaging>
...
...
</microsoft.web.services2>

You can find out how to set these individual timeouts by lookign at the
WSE.Config file in the "Microsoft WSE\v2.0" directory
of where you installed this.

Hope this helps!

Sidd


[quoted text, click to view]

darren NO[at]SPAM prairiefyre.com
6/25/2004 7:36:38 AM
Excellent Sidd,
Thank you.

Darren

[quoted text, click to view]
AddThis Social Bookmark Button