Ниже приведен мой код для объекта, я использую вызов postasyn c для получения данных из Web Api, но застрял на этой части
[XmlRoot(Namespace = "http://www.constructivity.com/api/Data/xsd/Constructivity/Core", ElementName = "Library", IsNullable = true)]
public class UserObject
{
[XmlArray("Organizations")]
[XmlArrayItem("OrganizationReference", typeof(Organization))]
public List<Organization> Organizations { get; set; }
[XmlArray("a:Libraries")]
[XmlArrayItem("a:LibraryReference", typeof(Project))]
public List<Project> Projects { get; set; }
}
[XmlRoot(ElementName = "OrganizationReference", Namespace = "http://www.constructivity.com/api/Data/xsd/Constructivity/Core")]
public class Organization
{
[XmlElement("Name")]
public string Name { get; set; }
}
[XmlRoot(Namespace = "http://www.constructivity.com/api/Data/xsd/Constructivity/Access")]
public class Project
{
[XmlElement("a:Name")]
public string Name { get; set; }
}
Добавьте ниже строку xml, которую я использую `
<?xml version="1.0" encoding="utf-8" ?>
<Library z:Id="i1" xmlns="http://www.constructivity.com/api/Data/xsd/Constructivity/Core" xmlns:a="http://www.constructivity.com/api/Data/xsd/Constructivity/Access" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
<a:UUID>00000000-0000-0000-0000-000000000000</a:UUID>
<a:Name>admin</a:Name>
<a:Organizations>
<a:OrganizationReference>
<a:Name>buildingSMART</a:Name>
<a:Access i:nil="true"/>
</a:OrganizationReference>
<a:OrganizationReference>
<a:Name>siemens</a:Name>
<a:Access i:nil="true"/>
</a:OrganizationReference>
<a:OrganizationReference>
<a:Name>SSMA</a:Name>
<a:Access i:nil="true"/>
</a:OrganizationReference>
<a:OrganizationReference>
<a:Name>state</a:Name>
<a:Access i:nil="true"/>
</a:OrganizationReference>
</a:Organizations>
<a:Libraries>
<a:LibraryReference>
<a:Name>LignumData_Catalog</a:Name>
<a:Access i:nil="true"/>
</a:LibraryReference>
<a:LibraryReference>
<a:Name>Constructivity_Core</a:Name>
<a:Access i:nil="true"/>
</a:LibraryReference>
<a:LibraryReference>
<a:Name>componentassembly_PARTie</a:Name>
<a:Access i:nil="true"/>
</a:LibraryReference>
</a:Libraries>
</Library>
Застрял на этом слишком долго