Click here to Skip to main content
15,897,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone.

I have Wcf service lib which is hosted in a windows service and there is a method name "MyMethod" that the output type is my custom class named "my_struct" and it is inherited from List<t>.
when I want to consume this service in another application the wsdl shows the output of this method "MyMethod" is List<t> which must be "my_struct". What Should I do to solve this problem?

Thanks in advanced.
Posted
Comments
Henning Dieterichs 11-Apr-12 4:25am    
If you would show your WSDL, maybe we could help...
But in principle WSDL types != C#-types, Visual Studio maps them. Structs in C# are represented as Sequences in XSD-Schema (WSDL types).

1 solution

Your my_struct must be described as a DataContract. Once you define all your DataMembers on it you could use it in your ServiceContract as any other integral type. VS will create serializer and all the mappings for you.
See sample here[^]
 
Share this answer
 
v2
Comments
Jamal Seyedi 15-Apr-12 5:19am    
thanks Dear Sadovi

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