I'm building a rest api in C# - and I'm setting up some POST's - here's the interface:
[SecurityTokenValidator("Registered Users")]
[OperationContract]
[WebInvoke(ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml, UriTemplate = "camps/{campid}/markings/{token}", Method = "POST")]
MarkingDto InsertMarking(string campid, string token, MarkingDto markingDto);
And here's my MarkingDto
[DataContract(Namespace = "FreeBeer")]
public class MarkingDto
{
[DataMember] public int Id;
[DataMember] public decimal Latitude;
[DataMember] public decimal Longitude;
[DataMember] public string MarkingType;
[DataMember] public DateTime DateTime;
}
In building up a test POST in Fiddler - I'm noticing if my RequestBody isn't in Alphabetical order - some items come up null or zero. For instance - if the request body is like so - where Longitude comes BEFORE Latitude - Latitude will be zero (0).
<MarkingDto xmlns="BigGameLogic">
<Longitude>456</Longitude>
<Latitude>123</Latitude>
<MarkingType>Scrape</MarkingType>
</MarkingDto>
But if kept in alphabetical order - everything is there. Is this just a Fiddler thing? Or is this something I need to fix because of the easy solution I'm missing ;)