Click here to Skip to main content
15,391,989 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
 {
     ........
 }


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
 {
     .....................................
 }


in short I am unable to use all datacontract on client side, why?
Posted
Comments
   
Do you have [DataMember] attributes applied? You don't show but you have to.
--SA
Alimjan Yasin 23-Jun-11 22:57pm
   
I applied.
Nickos_me 23-Jun-11 6:46am
   
Serach or Search?
Alimjan Yasin 23-Jun-11 22:57pm
   
thanks for help me spot the uncorrect word. sometimes I do mistake like that, I am not native speaker of English

I find out what is going on.
the reason it did not show up is I defined datacontract , but did not use it in interface. after I use the datacontract I see it on client side.

by the way, thank you everyone !
   
Yes, Alimjan Yasin. You are right, after creating data contract class we have to use it in interface. But I don't get it why ? Hope somebody can help ?
   
Delete and update the Service Reference
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900