Здравствуйте, я получаю сообщение об ошибке:
<ArrayOfThemes xmlnx='http://brickset.com/api/'> was not expected.
Пробовал некоторые вещи, которые я нашел в Интернете, но все они терпят неудачу.
Это вывод XML, когда я вызываю SOAPAPI:
<ArrayOfThemes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="https://brickset.com/api/">
<themes>
<theme>4 Juniors</theme>
<setCount>24</setCount>
<subthemeCount>5</subthemeCount>
<yearFrom>2003</yearFrom>
<yearTo>2004</yearTo>
</themes>
</ArrayOfThemes>
Классы:
public class Themes
{
[XmlElement("theme")]
public string Theme { get; set; }
[XmlElement("setCount")]
public string SetCount { get; set; }
[XmlElement("subthemeCount")]
public string SubthemeCount { get; set; }
[XmlElement("yearFrom")]
public string YearFrom { get; set; }
[XmlElement("yearTo")]
public string YearTo { get; set; }
}
[Serializable, XmlRoot("ArrayOfThemes")]
public class ArrayOfThemes
{
[XmlElement("themes")]
public Themes Themes { get; set; }
}
А затем обычно обычный десериализованный код.По-прежнему не удается преобразовать объекты XML в список тем.
Как вы обрабатываете пространства имен xmlns?