views:

224

answers:

0

Hi,

I have a webservice that uses a custom object which inturn has an array of custom objects:

[Serializable]
public class SerializedObjectList
{
    [XmlElement("LineItems", IsNullable = true)]
    public SerializedObjectItem[] MyArray { get; set; }
}

[Serializable]
public class SerializedObjectItem
{
    [XmlElement("MyVarOne", IsNullable= true)]
    public String varone { get; set; }
    [XmlElement("MyVarTwo", IsNullable= true)]
    public String vartwo { get; set; }
}

My issue is the WSDL will produce something similar to:

<s:complexType name="SerializedObjectList"> 
    <s:sequence> 
      <s:element minOccurs="0" maxOccurs="unbounded" name="LineItems" nillable="true" type="tns:SerializedObjectItem" /> 
    </s:sequence> 
</s:complexType> 

I would like it to say MinOccurs="1". Is this possible?

Also looking for an answer to this I came across the link below. Is it true that the WSDL is more of a "guide" than anything else and will not reject requests that do not fulfil the requirements?

http://stackoverflow.com/questions/1156498/how-to-set-minoccurs-to-1/1156574#1156574

Thanks