How to specifiy default values in WCF web services (repost)



Hello,

I am trying to specify a logical default value for a [DataMember] in a WCF
Web Service using basicHttpBinding.

I realize that the language defaults are:

int - 0
string - null
bool - false
enum - ?

I tried using OnDeserializing and OnDeserialized events, but when the client
doesn't explicitely set the value for an int member, for instance, I keep
getting 0. For a bool memeber I get a 'false', and for an enum member it
picks some default, but I don't know how it picks it. The only default that
I can logically work with is the null for reference types, including
strings.

The XSD allows you to specify "default=" attribute for a member, but in WCF
I don't have control over wsdl/schema generation. So I thought there would
be a way to specify a logical default value for a DataMember through an
Attribute settings of some sort, but I can't find one.

Please help!!!

thanks, Dave


.



Relevant Pages

  • WCF Web Services default values for a DataMember
    ... I am trying to specify a logical default value for a in a WCF Web Service using basicHttpBinding. ... I tried using OnDeserializing and OnDeserialized events, but when the client doesn't explicitely set the value for an int member, for instance, I keep getting 0. ... So I thought there would be a way to specify a logical default value for a DataMember through an Attribute settings of some sort, ...
    (microsoft.public.dotnet.framework.webservices)
  • WCF Defatul DataMember value problem
    ... I am trying to specify a logical default value for a [DataMember] in a WCF ... doesn't explicitely set the value for an int member, for instance, I keep ...
    (microsoft.public.dotnet.framework.webservices)
  • How to specify default values in WCF web services
    ... I am trying to specify a logical default value for a [DataMember] in a WCF ... doesn't explicitely set the value for an int member, for instance, I keep ...
    (microsoft.public.dotnet.framework.webservices)
  • Ref: Toni Erdmann - GCC difference in size of long
    ... It seems unfair to me that the response Must go to the group you have ... order to compile it. ... error signal caused by a single misplaced int is particularly hard to find. ... You can also specify the architecture of the target. ...
    (alt.os.linux.suse)
  • Re: Wheres the mistake???
    ... Implicit int ... always a good idea to specify the return type of all functions anyhow. ... As I hope you are aware, a prototype is a function ... Dig the even newer still, yet more improved, sig! ...
    (comp.lang.c)