Pierre Greborio.NET

Talking about .NET world

Default value for elements on the WSDL

Sometimes you need to define a default value for an element into the WSDL type section. Consider the following XML snippet code:

<s:element minOccurs="0" maxOccurs="1" default="100" name="MaxLimit" type="s:double" />

to get the default value automatically you can set it by decorating the property (MaxLimit) with the attribute System.ComponentModel.DefaultValueAttribute as following:

[System.ComponentModel.DefaultValue(100)]
public double MaxLimit;

Posted: Jan 16 2004, 02:51 PM by PierreG | with no comments
Filed under:

Comments

No Comments