How can I send a generic list of the type of an interface to a WCF method? the problem I have is that the client generated the list as List<object>
instead of using the interface.
Asked
Active
Viewed 888 times
1

Andrew Hare
- 344,730
- 71
- 640
- 635

ryudice
- 36,476
- 32
- 115
- 163
-
It might be useful to post your Data/Service/Operation contracts – Andy White Mar 16 '11 at 22:34
-
Is that interface available in the client? – Andrew Hare Mar 16 '11 at 22:34
1 Answers
6
That's probably because the client doesn't know what implementations exist for this interface as they are not part of the exposed metadata. You could use known types to include those possible implementation in the WSDL.

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
-
Where should I place the knowtype attribute? Should I create a class that implements my interface and define is a datacontract and the apply the knowtypeattribute with the interface type? and should I leave my parameter as List
? – ryudice Mar 16 '11 at 22:48 -
@ryudice, there are many possibilities, all covered by the article on MSDN I linked to. Personally I do this in web.config as it is the least obtrusive way. – Darin Dimitrov Mar 16 '11 at 22:49