I have a WCF service method which I have written for return type as collection type.
But if I generate a proxy class and consume the method from the client the methods return type is changed from a collection to an array.
Why is this happening?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to tell
svcutilto generate the types as whatever generic type you want. You do this by adding this switch to the svcutil command:The
/ctis short for/collectionType. In this case I specifiedCollection<T>but you could have just as easily usedSystem.Collections.Generic.List<T>.