Here is another programming blog entry. Sorry for the normal friends :)
I recently ran into a problem with a web service I was trying to call
from c# where the web service returned null dates (and other null
values on elements that end up de-serialized as value types)
I didn't find any good solutions online (other than wait for nullable
types in c# 2.0 or change the service, neither of which was applicable
in my situation)
I ended up working out a solution with microsoft, and here it is. The
following class will loop through a returned soap call, and set any
datetime fields that are null to be DateTime.MinDate
This can easily be extended to enable any other fields that need
default values (enums, etc)
This solution uses reflection, SoapExtension, SoapExtensionAttribute,
etc to solve the problem. A complete example can be found on my blog :
http://geekswithblogs.net/gaijin42/a.../18/57332.aspx