XML Serialization



cant find a solution for:


Have some xml



<address>ADDRESS</address>
<cc_cvc />
<cc_expiration_date>01/2022</cc_expiration_date>


And try to deserialize some of this



public int creditCardCVC;

[XmlElement("cc_cvc")]
public int CreditCardCVC { get { return creditCardCVC; } set { creditCardCVC = (int)value; } }


or some of this



[XmlElement("cc_cvc", IsNullable=true)]
public int CreditCardCVC { get; set; }


And take some error in deserialize method "There is an error in XML document (8, 2)"


if this property declare like a string all is working, but int create error. Please tell me how to save Int but may be set not required this field or some thing else


Thank you


No comments:

Post a Comment