How to specifiy default values in WCF web services (repost)
- From: "Dave Burns" <dburns@xxxxxxxxxxxxxxxx>
- Date: Tue, 15 Jul 2008 10:12:58 -0500
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
.
- Follow-Ups:
- RE: How to specifiy default values in WCF web services (repost)
- From: Steven Cheng [MSFT]
- RE: How to specifiy default values in WCF web services (repost)
- Prev by Date: RE: How to Authenticate to WCF Service Via VPN
- Next by Date: RE: How to Authenticate to WCF Service Via VPN
- Previous by thread: RE: How to Authenticate to WCF Service Via VPN
- Next by thread: RE: How to specifiy default values in WCF web services (repost)
- Index(es):
Relevant Pages
|