views:

30

answers:

0

We're using DataContractSerializer to deserialise XML data coming into a RESTful API written in MVC.Net. I'm trying to send a list of objects into an action method, however the deserialisation always returns null, even when using XML serialised from the same classes. Does anyone have any idea's of why this is happening. Code is below.

[DataContract(Name = "Item", Namespace="")]
public class ItemForCreation
{
    [DataMember]
    public string Value { get; set; }
}

[CollectionDataContract(Name="Items", Namespace="", ItemName="Item")
public class ItemsToCreate : List<ItemForCreation> { }

The controller action method accepts a single parameter of type ItemsToCreate.

Thanks in advance.