473,245 Members | 1,750 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,245 software developers and data experts.

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 1114

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: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.