Re: How to specifiy default values in WCF web services (repost)
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng [MSFT])
- Date: Fri, 18 Jul 2008 06:55:07 GMT
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Thanks for your reply Dave,
\par
\par 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).
\par
\par 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).
\par
\par Sincerely,
\par
\par Steven Cheng
\par
\par Microsoft MSDN Online Support Lead
\par
\par
\par 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: msdnmg@xxxxxxxxxxxxxx
\par
\par ==================================================
\par Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.
\par
\par ==================================================
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par \pard\li720 --------------------
\par From: "Dave Burns" <dburns@xxxxxxxxxxxxxxxx>
\par References: <#x4yd1o5IHA.4848@xxxxxxxxxxxxxxxxxxxx> <H2VnL0v5IHA.5852@xxxxxxxxxxxxxxxxxxxxxx>
\par Subject: Re: How to specifiy default values in WCF web services (repost)
\par Date: Thu, 17 Jul 2008 08:31:21 -0500
\par
\par
\par Language defaults don't work for me, because they are not logical defaults.
\par
\par The [EmitDefaultValue=false] only works for microsoft clients using svcutil
\par generated proxy file, correct? What if it's a Java client consuming my WCF
\par service? How can I be sure that what came over the wire is a language
\par default value or my logical default value?
\par
\par Here's a concrete example:
\par
\par I have a property called PerfectPrintAngle, it's an integer.
\par Its logical default value is -1, which tells the web service not to use
\par PerfectPrintAngle (valid values are from 0 to 359)
\par Its language default value is 0, which is in the correct range.
\par
\par So if it comes in over the wire as 0 (language default), the web service has
\par no way of telling whether this was defaulted on the client side or actually
\par set to 0 by the client program.
\par
\par I hope I am explaining this correctly!
\par
\par Thanks, Dave
\par
\par
\par \pard
\par
\par }
- 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)
- References:
- How to specifiy default values in WCF web services (repost)
- From: Dave Burns
- 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)
- From: Dave Burns
- How to specifiy default values in WCF web services (repost)
- Prev by Date: .NET Alternative to SoapUI
- Next by Date: WCF Configuration secure load balanced with username and password
- Previous by thread: Re: How to specifiy default values in WCF web services (repost)
- Next by thread: Re: How to specifiy default values in WCF web services (repost)
- Index(es):
Relevant Pages
|
Loading