日期:2014-05-17  浏览次数:20965 次

WCF明明有值,但是返回到客户端确没有,怎么回事啊
 [ServiceContract]
    public interface IGetAssembly
    {
        [OperationContract]
        Dictionary<RemoteFileInfo, List<RemoteFileInfo>> GetAssembliesDic();

   

    }
  
    [DataContract]
    public class RemoteFileInfo
    {
        [DataMember]
        public string FileName;

        [DataMember]
        public long Length;

        [DataMember]
        public string Version;

        [DataMember]
        public byte[] FileByte;
    }


我就奇怪了,用wcf测试客户端测试,GetAssembliesDic是有返回值的,怎么在sliverlight中调用后,返回的结果就是无呢?

真是不爽啊,sliverlight真是不好用  
客户端 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "IGetAssembly")]
    public interface IGetAssembly
    {

       
        [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IGetAssembly/GetAssembliesDic", ReplyAction = "http://tempuri.org/IGetAssembly/GetAssembliesDicResponse")]
        System.IAsyncResult BeginGetAssembliesDic(System.AsyncCallback callback, object asyncState);

        System.Collections.Generic.Dictionary<GetAssembliesService.RemoteFileInfo, System.Collections.ObjectModel.ObservableCollection<GetAssembliesService.RemoteFileInfo>> EndGetAssembliesDic(System.IAsyncResult result);

       
        [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IGetAssembly/GetAssemblyStream", ReplyAction = "http://tempuri.org/IGetAssembly/GetAssemblyStreamResponse")]
        System.IAsyncResult BeginGetAssemblyStream(GetAssembliesService.DownloadRequest request, System.AsyncCallback callback, object asyncState);

        GetAssembliesService.RemoteFileInfo EndGetAssemblyStream(System.IAsyncResult result);
    }


另外我还有2帖子,谁去回答下吧,随便说点话,我好结贴,不然分都给不了