0
public List<dynamic> GetDynamicResult()
{
List<dynamic> lstDynamic = new List<dynamic>();
lstDynamic.Add(new { ID = "1", Name = "ABC" });
lstDynamic.Add(new { ID = "1", Name = "XYZ" });
return lstDynamic;
}
返回動態列表當我返回列表從WCF的ASP.NET Web應用程序中使用 List<dynamic> lstDynamic = objClient.GetDynamicResult();
到我得到這個錯誤:The underlying connection was closed: The connection was closed unexpectedly
如何從WCF HTTP服務
謝謝你的回覆這將是很好,如果你能給我一個簡單的例子 – Tuscan 2011-05-13 09:48:12
開始更改公共字符串GetDynamicResult(){etc}的功能。之後,您可以將所有內容打包爲XML,而不是字符串。在客戶端,您可以將字符串解壓縮爲XML,而不是.NET對象。 [與此主題相關的非常好的鏈接](http://www.c-sharpcorner.com/UploadFile/chauhan_sonu57/SerializingObjects07202006065806AM/SerializingObjects.aspx) – 2011-05-13 19:37:59