Post

Web Service Woes (Plea For Help!!!!)

OK, I’m getting to the end of the rope on this one. I’ve tried everything that I can think of and have searched Google a hundred times over… all to no avail.

I have two applications, one is a windows form application and the other a web service application. On some machines (starting about a month or so ago) the web service call will just “stop working” and cause the CPU usage to peg out at 100% until the web service call times out (since I’m using a synchronous call). No other clues to this problem other than this occurring. However, if I run the application in VS.NET in debug mode, an error will occur. After a web service call completes and no further call occurs… sometime between five and six minutes after that last call the following error will be displayed:

Unhandled exception of type ‘System.NullReferenceException’ occurred in system.dll

The problem with this error, beyond the fact that it doesn’t show up in release mode, is that it can’t be handled!?!?! Also, the error is occurring within the FCL within the System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback method. I’ve even attempted to use a Sub Main and add an event handler to capture all unhandled errors by doing the following:

1
2
3
4
5
6
7
8
9
10
Public Shared Sub Main()
  Dim currentDomain As AppDomain = AppDomain.CurrentDomain
  AddHandler currentDomain.UnhandledException, AddressOf MyHandler
  Application.Run(New Form1)
End Sub

Private Shared Sub MyHandler(Byval sender As Object, Byval e As UnhandledExceptionEventArgs)
  Dim ex As Exception = DirectCast(e.ExceptionObject, Exception)
  MsgBox(ex.Message)
End Sub

So, I’ve trimmed down the application to the bare minimum that will this error will occur in. Basically, it’s a WindowsForm application where the Form_Load event makes a call the web service and the web service consists of a single method that accepts a string and integer (doing nothing within the method). To test more accurately what the full blown application is doing, I’ve added a timer that occurs every 10 minutes to make the web service call again.

If I change the timer to occur every minute, the symptom appears to go away, but does appear to occur randomly sometime later within a several hours.

If any web service experts are reading this and are willing to help me with this problem, I can provide some sample code that can reproduce this. Any help would be much appreciated.

This post is licensed under CC BY 4.0 by the author.