I am using below Code for WCF Rest Services to get in JSON format
[OperationContract]
[WebGet(UriTemplate = "/GetOrderList?request={request}", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
IEnumerable<Order> GetOrderList(Request request);
I want this method to return XML type also. Do i need to have one more method for it ?
I want to do it in the same method without duplicating the code for XML.
I am using WCF 3.5. I cannot change my version.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…