好久没有上来写点东西了, 一直都比较忙, 而在公司的时候又禁止写Blog,今天开始给自己放长假,可以常来写写东西了。。。。
   在我做毕业设计 的过程中, 遇到的一个问题就是通过 WCF, Client端不能从Server端取得IList数据(放在IList当中的是自定义类型), 后来花了九牛二虎之力才找到讲这个问题的文章:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1460184&SiteID=1
发现原因是我没有在ServiceContact 上加一个Attribute: ServiceKnownType.

下面代码引自那篇文章:

WCF 不能传输 IList? 解决方案using System;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.ServiceModel;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.ServiceModel.Description;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.ServiceModel.Dispatcher;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.ServiceModel.Channels;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.Runtime.Serialization;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.Collections;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
using System.Collections.Generic;
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案 
WCF 不能传输 IList? 解决方案
WCF 不能传输 IList? 解决方案
public interface IPerson
WCF 不能传输 IList? 解决方案

 

相关文章:

  • 2021-11-05
  • 2021-08-03
  • 2021-06-03
  • 2021-08-21
  • 2022-02-23
  • 2021-11-12
  • 2021-06-25
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2021-11-02
  • 2021-08-10
  • 2021-11-18
  • 2021-11-12
相关资源
相似解决方案