什么也不多说,直接贴代码
需要反序列的XML
成功 湛江 漳州
反序列化Model:
[XmlRoot("GetCitiesListResponse")] public class GetCitiesListResponse { public Result Result { get; set; } [XmlArray("CitiesList"), XmlArrayItem("City")] public City[] CitiesList { get; set; } } public class Result { [XmlAttribute("Code")] public string Code { get; set; } [XmlText] public string Value { get; set; } } [XmlRoot("City")] public class City { [XmlAttribute("PinYin")] public string PinYin { get; set; } [XmlAttribute("HasOutService")] public string HasOutService { get; set; } [XmlText] public string Value { get; set; } }
后台代码不算本话题的核心,就不贴出来了。。。。。。。