本文介绍了WCF datacontract问题,无法查看所有datacontract的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个wcf项目。在服务方面,我定义了像这样的datacontract



I am working on a wcf project. at service side I defined datacontract like that

[ServiceContract]
 public interface IDictionaryService
 {
     [OperationContract]
     TranslationData TranslateWord(TranslationData tData);
 }
 [DataContract]
 public class TranslationData
 {
     ........
 }





我在客户端成功使用了TranslationData实例。然后我再添加两个datacontract,问题是我看不到两个新添加的datacontract,无法在客户端定义他们的实例。我更新了服务并做了所有事情,但它不起作用。

有没有人告诉我为什么会发生这种情况?



整个代码如下所示





I successfully used the TranslationData instance on client side. then I add two more datacontract , problem is I can't see the two new added datacontract and unable to define their instance on client side. I updated the service and did everything but it dose not work.
is there any one who tell me why that happend?

whole code is shown as below

[ServiceContract]
 public interface IDictionaryService
 {
     [OperationContract]
     TranslationData TranslateWord(TranslationData tData);
 }
 [DataContract]
 public class TranslationData
 {
     ...........................
 }

 [DataContract]
 public class SerachItem
 {
     .................................
 }

 [DataContract]
 public class TargetItem
 {
     .....................................
 }





总之我无法在客户端使用所有datacontract,为什么?



in short I am unable to use all datacontract on client side, why?

推荐答案




这篇关于WCF datacontract问题,无法查看所有datacontract的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 13:43