473,473 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1117

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

Similar topics

2
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In...
0
by: Robert Rae | last post by:
Does anyone know of a way to set minoccurs and maxoccurs from an attribute. An example would be: public string HelloWorld(DataInput dataInput) { return "Hello World"; } public class...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, apologies for tghe repost, but I cannot get an answer to my question and I have noe posted on 7 news groups. Can someone tell me why the following scneario occurs. With the nillable attribute...
7
by: rbarschaw | last post by:
I have the following schema designed: <xs:complexType name="AzzFeature-BoxType" mixed="true"> <xs:choice minOccurs="1" maxOccurs="unbounded"> <xs:element ref="Sub-Head" minOccurs="1"...
1
by: Lucvdv | last post by:
In a VB.Net webservice, after adding a data class, members of type String get a "minOccurs=0" attribute in the generated WSDL. Is there an attribute you can apply to the definition, or some other...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
6
by: bruce_phipps | last post by:
If I have an <element name="test" maxOccurs="unbounded"> with no minOccurs attribute specified does this mean I can have 0..unbounded occurences of <test>? Or 1..unbounded occurences of test? ...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.