0
如何在wcf中使用DataContractSerializer反序列化嵌套的xml? 示例xml是;如何在wcf中使用DataContractSerializer反序列化嵌套的xml?
<smsPaidPhoneBookSearchResponse xmlns="http://callturksvc.alfion.com.tr">
<webServiceResponseType>SUCCESS</webServiceResponseType>
<clientQueryId>112628650000001078</clientQueryId>
<phoneBookList>
<phoneBook>
<cityName>İstanbul</cityName>
<districtName>Beşiktaş</districtName>
<firstName>Şuayp</firstName>
<lastModifiedDateTime>2013-03-06T16:05:59.508+02:00</lastModifiedDateTime>
<lastName>Çiçek</lastName>
<phoneBookTypeEnumValue>TURKCELL</phoneBookTypeEnumValue>
<phoneNumberText>5353572115</phoneNumberText>
</phoneBook>
<phoneBook>
<cityName>İstanbul</cityName>
<districtName>Beşiktaş</districtName>
<firstName>Şuayp</firstName>
<lastModifiedDateTime>2013-03-06T16:05:59.510+02:00</lastModifiedDateTime>
<lastName>Çiçek</lastName>
<phoneBookTypeEnumValue>TURKCELL</phoneBookTypeEnumValue>
<phoneNumberText>5359571655</phoneNumberText>
</phoneBook>
</phoneBookList>
</smsPaidPhoneBookSearchResponse>
我成功地獲取這些值(webServiceResponseType,clientQueryId),但我不能讓phoneBookList的電話簿類的泛型列表。例如:List<phoneBook>
任何解決方案?
我將phoneBookList標記爲DataMember – 2013-03-16 08:46:38
請注意,當您使用DataMemeber屬性標記它們並且不爲其添加名稱時,它將序列化程序查找類名稱的完全匹配。嘗試向DataMember屬性添加名稱,如 '[DataMember(Name =「phoneBook」)]' 並查看是否有效。 – achakravarty 2013-05-02 04:35:10