I am trying to databind in a web api next xml: application/xml to a class
<COMPANY>
<PROPERTIES>
<DATASOURCE>UXXI</DATASOURCE>
<DATETIME>2012-07-11T11:18:12</DATETIME>
</PROPERTIES>
<PERSON recstatus="1">
<SOURCEDID>
<SOURCE>U123XXI</SOURCE>
<ID>usuario26</ID>
</SOURCEDID>
<USERID password="123456">usuario26</USERID>
<NAME>
<FN>Usuario Prueba 26</FN>
<PI>
<FAMILY>Prueba 26</FAMILY>
<GIVEN>Usuario</GIVEN>
<EMAIL>[email protected]</EMAIL>
</PI>
</NAME>
</PERSON>
</COMPANY>
To class:
public class COMPANY {
public class PROPERTIES {
public string DATASOURCE { get; set; }
public string MYDATE { get; set; }
}
public class PERSON {
public string recstatus { get; set; }
public class SOURCEID {
public string SOURCE { get; set; }
public string ID { get; set; }
}
public class USER {
public string password { get; set; }
public string USERID { get; set; }
}
public class NAME {
public string FN {set; get;}
public class PI {
public string FAMILY { set; get; }
public string GIVEN { set; get; }
public string EMAIL { set; get; }
}
}
}
}
In controller I have :
[HttpPut]
public HttpResponseMessage GetPerson(COMPANY req) {
...
}
How can I databind it?
I use PostMan to send request
I am getting null in the controller because I think I have to databind class with XML.