473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

WCF Web Services default values for a DataMember

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 Raskin
Rimage Corporation

Jun 27 '08 #1
0 2611

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Douglas Robson | last post by:
Ok, I've removed the MyItem class which is found in References.cs and replaced it with a reference to the namespace that has MyItem in it. I've also got rid of the tag at the top of the MyItem...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
3
by: robboll | last post by:
I am building an ASP.NET data entry form and when I change the values per the dropdowns and click "save", the old values remain. Are there any suggestions on how to update the variables to the...
1
by: Russ | last post by:
Whats wrong with this code? DataSet ds = new DataSet(); DataTable tbl = new DataTable("Tbl"); tbl.Columns.Add("field1", typeof(string)); tbl.Columns.Add("field2", typeof(string));...
0
by: Alex | last post by:
I have a web service in which I declare a user defined object. One of the properties, I declare it and default it's value as follows: private DateTime _callbackTime =...
1
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
In the Visual Studio 2005 designer, I have a grid, a binding source, and a data set which contains two data tables. In the Designer, I make the settings below. If I set the DataMember for the...
2
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, I have this data contract: public class MyClass { public String mySTR{get; set;}
0
by: Dave Burns | last post by:
Hello, I am trying to specify a logical default value for a in a WCF Web Service using basicHttpBinding. I realize that the language defaults are: int - 0 string - null bool - false
4
by: Dave Burns | last post by:
Hello, I am trying to specify a logical default value for a in a WCF Web Service using basicHttpBinding. I realize that the language defaults are: int - 0 string - null bool - false
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.