I have consumed a WSDL and one of the fields was from a enum type and in the generated reference.cs it created two fields for this:
The field was called 'IsPayment' and it generated one called IsPaymentField and IsPaymentFieldSpecified
I read from this answer: Why isn't my public property serialized by the XmlSerializer?
That items with public bool xxxSpecified with value of false are not serialized
So I manually in code set it to True and it worked.
But what has caused this field to generate this Specified field when every other field that uses the same struct does not?
the only difference I can see is in the WSDL this field has explicitly got: nillable=true minOccurs=0
all other fields have nothing, but the enum itself is defined as: nillable="true"
So the only difference is minOccurs on my value?
Thanks.