Hey!
I'm trying to generate a proxy class with WCF which, when serialized, converts and instance of the class below into the XML below.
However, when I try to apply namespaces to the classes, they're inserted incorrectly, or not at all.
What am I doing wrong? How can I fix this?
Many thanks in advance.
Class Structure:
[XmlRoot]
public class Request
{
public int Id
public Name Name {get;set;}
}
[XmlRoot]
public class Name
{
[XmlAttribute]
public bool test {get;set;}
public string FirstName {get;set;}
public string LastName {get;set;}
}
Desired XML structure (superfluous XML trimmed):
<x1:Request xmlns:x1="Data/Main" xmlns:x2="Data/All">
<x2:Id>0</x2:Id>
<x2:Name test="true">
<x2:FirstName>Dan</x2:FirstName>
<x2:LastName>Atkinson</x2:LastName>
</x2:Name>
</x1:Request>