
Signature
incognito @ http://kentpsychedelic.blogspot.com
1) No. See http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85556.aspx for
more info.
2) No. Maybe in Framework 2.0 where nullable variables or how you call it,
are supported. If the parameter type is an object, you can of course, pass a
null value.
3) Not sure I understand what you mean :)
> 1) Do c# web methods support default parameters ?
>
[quoted text clipped - 10 lines]
> of the data for that parameter is null ? How should a null be passed
> to the web service ?
novelle.vague - 01 Aug 2004 17:48 GMT
Thanks. That's a good blog.
Unfortunately for us web methods don't support overloading !
So for a consumer of a web service, he has to account for all parameters
with 'dummy data' I guess...
That means if his value is null, for an int, and he wants to pass a record
to me with a web service/method, he has to make up a value like 0, and use
that.
That's not good integrity.
> 1) No. See http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85556.aspx
> for more info.
[quoted text clipped - 20 lines]
>> --
>> incognito @ http://kentpsychedelic.blogspot.com

Signature
http://kentpsychedelic.blogspot.com
Not sure I understand the question fully. But you could box the int in an
object and pass that or null ( I think ) or create a DBInt struct value type
like in Anders H. C# book (I just saw the code a bit.)

Signature
William Stacey, MVP
> 1) Do c# web methods support default parameters ?
>
[quoted text clipped - 10 lines]
> of the data for that parameter is null ? How should a null be passed
> to the web service ?
novelle.vague - 02 Aug 2004 03:52 GMT
> Not sure I understand the question fully. But you could box the int in an
> object and pass that or null ( I think ) or create a DBInt struct value
> type like in Anders H. C# book (I just saw the code a bit.)
So are you saying given:
public int NullTest(int i)
{
returns i++;
}
I could say:
object o = null; // box null into an object box
int value2 = (int) o; // unbox into value2
public int NullTest(value2); // ???
Or should I configure NullTest() like:
public int NullTest(obj o)
{
returns ((int) o) ++ ;
}
And call it with
object o = null;
int j = NullTest(o); // ???
Because a datatype o can be null, but a datatype int cannot accept a null
value when passed in as a parameter ?

Signature
http://kentpsychedelic.blogspot.com