I think if you modify your code like so:
[System.Xml.Serialization.XmlElementAttribute("XXXX ",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public myType XXXXX;
[System.Xml.Serialization.XmlIgnore]
public bool XXXXXSpecified;
....you may get what you want. minOccurs="0" and nillable="true".
-Dino
--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ OmitThis . m i c r o s o f t . c o m
"Andy" <> wrote in message
news: om...
> Hi,
>
> When setting the XMLElementAttribute IsNullable=false I get the
> minOccurs=0 in my WSDL:
>
> C#:
> [System.Xml.Serialization.XmlElementAttribute("XXXX ",
> Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
> public myType XXXX;
> WSDL:
> <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="XXXX"
> type="s0:myType" />
>
>
> When setting the IsNullable=true
>
> C#:
> [System.Xml.Serialization.XmlElementAttribute("XXXX ",
> Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
> public myType XXXXX;
> WSDL:
> <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="XXXX"
> nillable="true" type="s0:myType" />
>
>
> How can I set IsNullable=true and keep minOccurs="0"?
>
> Any ideas?
>
> Thanks,
> Andy
|