I have to serialize the following object using ServiceStack.Text.XmlSerializer.Serialize removing all the attributes. I know that it's a bad practice but I've to dialog with an old c++ written server via simulated XML (it's parsed manually) and it doesn't handle the attributes and so on
My class is
[DataContract(Namespace = "", Name = "DataValutaRequest")]
public class DateValueRequestPayload
{
[DataMember()]
public int Cross { get; set; }
[DataMember()]
public DateTime TradeDate { get; set; }
}
and it got serialized to
<?xml version="1.0" encoding="utf-8"?><DataValutaRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Cross>11</Cross><TradeDate>2015-07-27T00:00:00+02:00</TradeDate></DataValutaRequest>
I need to remove
<?xml version="1.0" encoding="utf-8"?>
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
How can I do that? Thanks