We've been seeing this exception:
##### Unhandled Exception while running
System.Exception: WSE104: An asynchronous callback raised an exception. --->
System.InvalidOperationException: Queue empty.
at System.Collections.Queue.Dequeue()
at
Microsoft.Web.Services2.Messaging.SoapInputChannel.EndReceive(IAsyncResult
result)
at
Microsoft.Web.Services2.Messaging.SoapReceivers.OnReceiveComplete(IAsyncResult ar)
at Microsoft.Web.Services2.AsyncResult.Complete(Boolean
completedSynchronously, Exception exception)
--- End of inner exception stack trace ---
thrown randomly in our nightly automated tests, and I've spent the last week
isolating it. This small sample program is fairly consistent at reproducing
the bug:
Project Type: Console Application (.NET Framework Runtime Version 1.1.4322)
References:
* Microsoft.Web.Services2 (Version 2.0.1.0, File Version 2.0.4189.0)
* System (Version 1.0.5000.0, File Version 1.1.4322.2032)
* System.Web (Version 1.0.5000.0, File Version 1.1.4322.2032)
-------------------- SimpleWSE.cs --------------------
using Microsoft.Web.Services2.Messaging;
using System;
namespace WSEReceiversTest
{
public class SimpleWSE : SoapService
{
private Uri _uri;
public SimpleWSE()
{
string url = "soap.tcp://" + System.Net.Dns.GetHostName() + ":" + 5060 +
"/SimpleWSE";
_uri = new Uri(url);
}
public void Initialize()
{
SoapReceivers.Add(_uri,this);
}
public void Deinitialize()
{
SoapReceivers.Remove(_uri);
}
}
}
-------------------- SimpleWSETest.cs --------------------
using System;
using System.Reflection;
using WSEReceiversTest;
namespace WSEReceiversTest
{
public class SimpleWSETest
{
[STAThread]
public static void Main()
{
try
{
CauseQueueException();
Console.WriteLine("No exception.");
Console.Out.Flush();
}
catch (Exception ex)
{
Console.WriteLine("Exception:\r\n" + ex.ToString());
Console.Out.Flush();
}
Console.WriteLine("\r\nPress enter to continue.");
Console.ReadLine();
}
public static void CauseQueueException()
{
SimpleWSE simpleWSE = new SimpleWSE();
simpleWSE.Initialize();
simpleWSE.Deinitialize();
DateTime endTime = DateTime.Now.AddMinutes(5);
Console.WriteLine("Beginning work. Work will be completed at
approximately " + endTime.ToString("t"));
Console.Out.Flush();
while (DateTime.Now < endTime)
{
//Anything can be done within the loop, but time has to pass.
Assembly.GetExecutingAssembly().GetExportedTypes();
}
simpleWSE.Initialize();
}
}
}
Scott Stout - 22 Nov 2004 22:51 GMT
We are seeing the same problem. We are using NAnt to automate our NUnit
tests. This whole program is shut down until we find a workaround or fix for
this. Anyone have any ideas why this is happening?
> We've been seeing this exception:
>
[quoted text clipped - 103 lines]
>
> }