Silverlight 4 + WCF序列化与反序列化有关问题

Silverlight 4 + WCF序列化与反序列化问题
我用VS2010作为开发环境,Silverlight 4 + WCF。我在WCF中序列化了一组数据,但在Silverlight中反序列化时,提示我没有“无参构造函数”,我明明写了啊,不知道是什么问题,望各兄弟赐教,先在此谢过。下面上代码。

WCF代码:接口

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.Serialization;
 using System.ServiceModel;
 using System.ServiceModel.Web;
 using System.Text;
 using System.IO;

 namespace WcfServiceForSilverlight
 {
 [ServiceContract]
 public interface ITestService
 {
 [OperationContract]
 void GetDataFromMemory(out MemoryStream stream);
 [OperationContract]
 MNLValues GetMNLTest();
 [OperationContract]
 string GetStr(int val);
 [OperationContract]
 List<MNLValues> GetMNL();
 }


 [DataContract]
 public class MNLValues
 {
 public MNLValues() { }
 [DataMember]
 public string ShiJian
 { get; set; }
 [DataMember]
 public double GaoDu
 { get; set; }
 [DataMember]
 public double ShuDu
 { get; set; }
 }
 }

实现:

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.Serialization;
 using System.ServiceModel;
 using System.ServiceModel.Web;
 using System.Text;
 using System.IO;

 namespace WcfServiceForSilverlight
 {
 // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码、svc 和配置文件中的类名“Service1”。
 public class TestService : ITestService
 {

 public TestService()
 {
 //
 }

 private void GetStreamData(MemoryStream stream, List<MNLValues> lists)
 {
 DataContractSerializer ser = new DataContractSerializer(typeof(List<MNLValues>));

 ser.WriteObject(stream, lists);
 }

 private List<MNLValues> GetTestList()
 {
 MNLValues mnl;
 List<MNLValues> lists = new List<MNLValues>();
 Random r = new Random(2);
 for (int i = 0; i < 30; i++)
 {
 mnl = new MNLValues() { ShiJian = i.ToString(), GaoDu = r.Next(300, 500), ShuDu = r.Next(800, 1000) };
 lists.Add(mnl);
 }

 return lists;
 }


 public void GetDataFromMemory(out MemoryStream stream)
 {
 stream = new MemoryStream();
 GetStreamData(stream, GetTestList());
 }


 public MNLValues GetMNLTest()
 {
 throw new NotImplementedException();
 }

 public string GetStr(int val)
 {
 return val.ToString();
 }

 public List<MNLValues> GetMNL()
 {
 return GetTestList();
 }
 }
 }

在Windows中调用正常,代码如下

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using testService.ser;
 using System.Runtime.Serialization;
 using System.IO;

 namespace testService
 {
 class Program
 {
 static void Main(string[] args)
 {
 TestServiceClient client = new TestServiceClient();

 DataContractSerializer s = new DataContractSerializer(typeof(List<MNLValues>));

 MemoryStream stream = client.GetDataFromMemory();

 stream.Position = 0;

 List<MNLValues> lists = (List<MNLValues>)s.ReadObject(stream);

 foreach (MNLValues m in lists)