Optional Parameter for Message Type

May 23, 2007 at 3:36 PM
I'd like to have some optional parameters in my MessageType. I have basic types like System.Int and System.bool in my message request object. When the client does not set these values in the generated proxy they are set to 0 or false when they get to the server. I would expect the values to be null on the server. Am i missing anything? Is there a better way?


May 23, 2007 at 5:41 PM
These basic/primitive types (actually value types) cannot have a null value so that's why you will never get nulls on the server side. You may try using nullable types like "Nullable<int>" or "Nullable<bool>" in order to get null values out of these types.

Charly