470,862 Members | 1,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

Setting minOccurs attribute

I'm building a class and I'm trying to use serialization attributes to set
minOccurs=1 and nullable=false

For example if I specify
[System.Xml.Serialization.XmlElementAttribute("Data ",IsNullable=false)] then
my wsdl looks like:
<s:element minOccurs="0" maxOccurs="1" name="Data" type="s:string" />

but if I specify
[System.Xml.Serialization.XmlElementAttribute("Data ",IsNullable=true)] then
my wsdl looks like:
<s:element minOccurs="1" maxOccurs="1" name="Data" nillable="true"
type="s:string" />

How do I specify minOccurs="1" maxOccurs="1" while leaving nillable="false"?
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://www.interiorhealth.ca/Schema")]
[System.Xml.Serialization.XmlRootAttribute(Namespac e="http://www.interiorhealth.ca/Schema",
IsNullable=false)]
public class Files
{
[System.Xml.Serialization.XmlArray("Files")]
public File[] File;
}
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://www.interiorhealth.ca/Schema")]
public class File
{
[System.Xml.Serialization.XmlElementAttribute("Data ",IsNullable=true)]
public string Data;

public System.DateTime CreationDate;

[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool CreationDateSpecified;
public string Description;

[System.Xml.Serialization.XmlAttributeAttribute()]
public string Name;
}
Jun 21 '06 #1
0 1052

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by joewhitehair | last post: by
reply views Thread by John Jenkins | last post: by
reply views Thread by John Jenkins | last post: by
reply views Thread by John Jenkins | last post: by
1 post views Thread by Lucvdv | last post: by
6 posts views Thread by bruce_phipps | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.