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帖子,谁去回答下吧,随便说点话,我好结贴,不然分都给不了
[解决办法]
我只想说对sliverlight不了解啊,但wcf传值传不过去好像遇到过。。。。
是不是配置文件里写错了?
[解决办法]
刚帮你搜了搜,有个帖子说到了这个情况,http://www.cnblogs.com/guanjie20/archive/2010/01/13/1646287.html
[解决办法]
对silverlight不熟,呵呵,应该是配置文件中的配置有些问题吧
[解决办法]
传不过去一般都是序列化的问题吧、你传过去的东西是自定义的类?
[解决办法]
有值就不是wcf的问题了,你再看看配置文件吧,八成是配置文件写错了,没有返回值
[解决办法]
你的“客户端”代码什么也说明不了,不知道你客户端代码到底是怎么写的?!
silverlight的各种网络访问是异步的,可能那需要程序员有点经验。没有任何经验的学生从未见识过那类并行、异步概念,自然感觉“不爽”。
要想简单地“爽”一下,就去写个小的控制台程序,那种程序对学生来说“无压力”。