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



{\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 }

Relevant Pages

  • Re: REST, SOAP, approaches to web connectivity
    ... Novell system after the BP IBM crew had told the client it ... as independent of the interface from the language to the DBMS. ...
    (comp.databases.pick)
  • Re: Advice Needed...
    ... and lower a dead language, but if it works for you and your clients, I don't ... | line) for a client in VB4.0 16 bit using Access databases. ... With Windows Vista, ... | standard panel or frame controls work perfectly. ...
    (microsoft.public.vb.general.discussion)
  • Re: VB.net and ASP.Net Typed Datasets
    ... upgraded the "backend" or data layer to SQL Server 2005. ... For these reasons we wish to use ASP.net, to have a Smart Client. ... inadequacies with the web controls and the winform. ... used in any .NET language. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VB.net and ASP.Net Typed Datasets
    ... be as robust as it can be if you build the app with Windows ... inadequacies with the web controls and the winform. ... The web forms controls must render to the client as standard ... used in any .NET language. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VB.net and ASP.Net Typed Datasets
    ... you can host Windows Forms via an ASP.NET web page. ... For these reasons we wish to use ASP.net, to have a Smart Client. ... inadequacies with the web controls and the winform. ... used in any .NET language. ...
    (microsoft.public.dotnet.framework.adonet)

Loading