首页 > 代码库 > WCF中DataContract用IEnumerable 类型导致传输错误

WCF中DataContract用IEnumerable 类型导致传输错误

错误信息如下:

"An error occurred while receiving the HTTP response to http://127.0.0.1/PlugInService_PMFDataService/PMFDataService. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."

 

本以为是传输大小超过限制 ,修改其maxReceivedMessageSize后,未果。

 

经google发现原来不能用IEnumerable 返回数据,应该采用List<>返回

WCF中DataContract用IEnumerable 类型导致传输错误