I am using ASP.Net Web API (WCF 4.0) method to return a List<WorkItem>
.
This is returning an xml with ArrayOf... in the form
<ArrayOfworkitem xmlns="http://schemas.datacontract.org/2004/07/AgilePortalServices.DataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<workitem>
<id>28</id>
<title>Test</title>
</workitem>
<workitem>
<id>27</id>
<title>Test Bug</title>
</workitem>
</ArrayOfworkitem>
But I want it returned as
<workitems>
<workitem>
<id>28</id>
<title>Test</title>
</workitem>
<workitem>
<id>27</id>
<title>Test Bug</title>
</workitem>
</workitems>
How do I do this?
This will be due to the serializer using the WCF XML serializer, instead of the default XmlSerializer.
You can modify this by stting the default formatters (and you can replace this with a 3rd party if you choose to).
More info at this web-api overview