Praveen_Bobbili
asked on
How to Expose Enums using WCF service
Hello,
I have a requirement that i need to expose my enums usign WCF service, Can any one provide me with the link.How to expose Enums using WCF service and how to consume them in at the client end..........
I have exposed enum in the below mentioned format, but when i am trying to acess the same at the client end i am not getting enum name in the intellisense..........
Code: Way i created enum in WCF project
[DataContract( Name = "QuestionType1")]
public enum QuestionType
{
[EnumMember]
MultipleChoice_OnlyOneAnsw er = 1,
[EnumMember]
MultipleChoice_MultipleAns wer = 2,
[EnumMember]
CommentOrEssayBOx = 3,
[EnumMember]
MatrixOfChoice_OnlyOneAnsw erPerRow = 4,
[EnumMember]
MatrixOfChoice_MultipleAns werPerRow = 5,
[EnumMember]
DropDownMenu = 6,
[EnumMember]
SingleTextBox = 7,
[EnumMember]
DescriptiveText = 9,
[EnumMember]
DemographicInformation_US = 10,
[EnumMember]
DemographicInformation_Int ernational = 11,
[EnumMember]
DateorTime = 12,
[EnumMember]
Email = 13,
[EnumMember]
HelpText = 14,
[EnumMember]
MultipleTextBox = 15,
[EnumMember]
PhoneNumber = 16,
[EnumMember]
NumberDropDownMenu = 17
}
I am not able to find QuestionType1 when i am trying to consume this service...............
I have a requirement that i need to expose my enums usign WCF service, Can any one provide me with the link.How to expose Enums using WCF service and how to consume them in at the client end..........
I have exposed enum in the below mentioned format, but when i am trying to acess the same at the client end i am not getting enum name in the intellisense..........
Code: Way i created enum in WCF project
[DataContract( Name = "QuestionType1")]
public enum QuestionType
{
[EnumMember]
MultipleChoice_OnlyOneAnsw
[EnumMember]
MultipleChoice_MultipleAns
[EnumMember]
CommentOrEssayBOx = 3,
[EnumMember]
MatrixOfChoice_OnlyOneAnsw
[EnumMember]
MatrixOfChoice_MultipleAns
[EnumMember]
DropDownMenu = 6,
[EnumMember]
SingleTextBox = 7,
[EnumMember]
DescriptiveText = 9,
[EnumMember]
DemographicInformation_US = 10,
[EnumMember]
DemographicInformation_Int
[EnumMember]
DateorTime = 12,
[EnumMember]
Email = 13,
[EnumMember]
HelpText = 14,
[EnumMember]
MultipleTextBox = 15,
[EnumMember]
PhoneNumber = 16,
[EnumMember]
NumberDropDownMenu = 17
}
I am not able to find QuestionType1 when i am trying to consume this service...............
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The comments given by the team not helped me in getting the solutions are even it not helped me work towards the solution. When ever i have discussed this issue with my other team members i have got the solution...............
[DataContract]
public enum UserDetails
{
[DataMember]
public string name;
[DataMember]
public QuestionType enum_test;
}