Here is one of the methods from my wcf rest service:
[OperationContract]
[WebInvoke(UriTemplate = "getInvoices", Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml)]
List<InvoiceRet> GetInvoices(GetInvoices getInvoices);
And it returns response in the next format:
<ArrayOfInvoiceRet>
<InvoiceRet></InvoiceRet>
<InvoiceRet></InvoiceRet>
...
<InvoiceRet></InvoiceRet>
</ArrayOfInvoiceRet>
How to modify method to return the next response
<ListInvoice>
<InvoiceRet></InvoiceRet>
<InvoiceRet></InvoiceRet>
...
<InvoiceRet></InvoiceRet>
</ListInvoice>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…