473,513 Members | 4,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setting minoccurs and maxoccurs with attributes

Does anyone know of a way to set minoccurs and maxoccurs from an attribute.
An example would be:

[WebMethod]
public string HelloWorld(DataInput dataInput)
{
return "Hello World";
}

public class DataInput
{
[XmlArrayItemAttribute("DataLineItem")]
public string[] DataLineItems = new string[10];
}

This results in:

<s:complexType name="DataInput">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DataLineItems"
type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="DataLineItem"
nillable="true" type="s:string" />
</s:sequence>
</s:complexType>

What I would like is the maxoccurs for DataLineItem to be 10:

<s:complexType name="DataInput">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DataLineItems"
type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="10" name="DataLineItem"
nillable="true" type="s:string" />
</s:sequence>
</s:complexType>

Nov 23 '05 #1
0 1000

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

Similar topics

2
6886
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 this example, the MessageID element should always occur (minOccur=1, maxOccur=1), but the WSDL generates minOccur=0. I can't pinpoint why this is...
0
1321
by: Kurt | last post by:
Hi, (sorry if I'm cross posting - not quite sure where to put) I am basically trying to force the user of my web service to only send a valid dataset that is based on a schema I have created. I have created a schema which references another schema (like a library of complex and simple types) that has a complex typed defined called...
3
5289
by: Mike | last post by:
I have created a web service for a client to consume. The element I am having trouble with is, as described in their WSDL: <xsd:element minOccurs="0" ref="LocalData" maxOccurs="1" /> <xsd:element name="LocalData"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Y" /> <xsd:enumeration value="N" />
7
2447
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" maxOccurs="unbounded"/> <xs:element ref="Title-Text" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="Text" minOccurs="0" maxOccurs="unbounded"/>...
0
1120
by: Jeremy Chapman | last post by:
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 then my wsdl looks like: <s:element minOccurs="0" maxOccurs="1" name="Data" type="s:string" /> but if I specify then
9
2988
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> <binaryobject3></binaryobject3>
0
1657
by: rt.64 | last post by:
Consider the C# webservice code and the .NET generated WSDL C# Webservice (Fragment) ================ ... public struct SSS { public decimal aaa ; public string bbb ; }
8
5679
by: rt.64 | last post by:
Consider the following C# webservice code and the corresponding WSDL generated by .NET: C# Webservice (Fragment) ================ ... public struct SSS { public decimal aaa ; public string bbb ;
6
2985
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? Thanks Bruce
0
7397
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
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 we have to send another system
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.