I have this xsd:
< xml version="1.0" encoding="ISO-8859-1" >
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:my="http://www.localhost.pt/MySchema" elementFormDefault="qualified" targetNamespace="http://www.localhost.pt/MySchema">
<element name="reply" type="my:TypeReply" />
<complexType name="replyType">
<sequence>
<element name="version" type="string" />
<element name="type" type="string" />
<element name="form" type="string" />
</sequence>
</complexType>
<complexType name="TypeReply">
<sequence>
<element name="id" type="string" minOccurs="1"/>
<element name="reply" type="my:replyType" minOccurs="1" maxOccurs="500" />
</sequence>
</complexType>
</schema>
I'm trying to generate the DataContract with SvcUtil.exe like this:
svcutil.exe my.xsd /dataContractOnly /serializer: DataContractSerializer /language:C# /out:MyDataContract.cs
But i'm having this error:
"Error: Type 'TypeReply' in namespace 'http://www.localhost.pt/MySchema' cannot be imported. 'maxOccurs' on element 'reply' must be 1. Either change schema so that the types can map to data contract types or use ImportXmlType or use a different serializer."
There is any chance that i could generate the DataContract with scvutil having elements with maxOccurs > 1
Note:
I really want to use the DataContractSerializer.
If i take out the maxOccurs the svcutil works just fine.