Thanks for your reply Dave,
I think I've got the actual issue you mentioned. Actually, you want to find
some means to let the wcf client get informed of the certain default value
for a certain field(no matter what programming platform the client is
using). I'm afraid this is abit difficult since for default value, this
is mostly a programming language layer feature, for example .net framework
class can set default value for class members. The WCF or webservice are
exposing service via WSDL/xml schema , it is difficult to let XML
description to force the client side programming platform generate code
which follow a logical rule. So far I haven't found such a means in xml
schema. For example, you can add some xml annotation/comments to indicate
the client side that what's the expected value/default value for the
certain field, however, it is still depend on the client-side's proxy
implementation (whether it adopt the annotation or WSDL description or
not).
So far I think the most guranteed means is still make sure both sides using
.net framework (actually this is the preferred approach for WCF ) so that
we can enforce such logical rules via code level definition such as default
value (or constructor initialization) .
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Dave Burns" <db****@newsgro up.nospam>
References: <#x************ **@TK2MSFTNGP05 .phx.gbl>
<H2************ **@TK2MSFTNGHUB 02.phx.gbl>
Subject: Re: How to specifiy default values in WCF web services (repost)
Date: Thu, 17 Jul 2008 08:31:21 -0500
Language defaults don't work for me, because they are not logical defaults.
The [EmitDefaultValu e=false] only works for microsoft clients using svcutil
generated proxy file, correct? What if it's a Java client consuming my WCF
service? How can I be sure that what came over the wire is a language
default value or my logical default value?
Here's a concrete example:
I have a property called PerfectPrintAng le, it's an integer.
Its logical default value is -1, which tells the web service not to use
PerfectPrintAng le (valid values are from 0 to 359)
Its language default value is 0, which is in the correct range.
So if it comes in over the wire as 0 (language default), the web service
has
no way of telling whether this was defaulted on the client side or actually
set to 0 by the client program.
I hope I am explaining this correctly!
Thanks, Dave