Wonders and Weirdness of Web Services
I just spent 3 hours trying to work out why one of two methods on a web service was failing with a NullReferenceException when both methods accepted the same first 3 parameters (one of which was apparently null) from the same 3 variables, and the other method was perfectly happy.
I'm not sure how it happened, maybe a global replace, or something, altough that doesn't match up really.
Anyway:
BeginMethod1(string About, string My, string Method)
Method1(string About, string My, string Method)
BeginMethod2(string About, string My, string Method)
Method2(string about, string My, string Method)
Calling Method 1 succeeds
Calling Method 2 fails
Did you spot the cause?
In the first 3 definitions, About started with a capital, in the last it started with a lower case.
The actual method parameter on the web service started with a capital.
The end result is that somewhere in the serialization or deserialization, the value is not transferred across, so that the web service, the parameter value is null.