How to deserialize a nested xml using DataContractSerializer in wcf? Example xml is;
<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>535357****</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>535957****</phoneNumberText>
</phoneBook>
</phoneBookList>
</smsPaidPhoneBookSearchResponse>
I get these values (webServiceResponseType,clientQueryId) succesfully but I can't get phoneBookList as a generic list of phoneBook class. e.g: List<phoneBook>
Any solution?
A simple way of finding out is to create a similar structure in C# and then serializing it. That ways you will know what is wrong in the xml. From my experience, have you marked phoneBookList as Array in the contract and then marked PhoneBook as Array Element with the right names?