1

In my WCF web method i have a operation contract which accepts List of string array, but when i create a proxy for this service it converts that to List of List of string.

    List<string[]> to List<List<string>>.

Can anyone please tell me if there is some way i can make sure that this does not happen and my proxy also contains List

Thanks

user1662008
  • 297
  • 1
  • 5
  • 17
  • When you add a service reference, you can chose whether to use Generics or Arrays for collections, look to see if you have set it to `Generic Collections` – Christian Phillips Jun 18 '14 at 16:22

3 Answers3

1

If you are using the Service Reference in VS, go to Configure Service Reference and set the collection type to System.Collections.Generic.List. That should fix it. If you are using svcutil the switch is /collectionType: http://msdn.microsoft.com/en-us/library/aa347733.aspx

Aditya Patil
  • 548
  • 4
  • 14
0

Have you tried editing the code generated by svcutil.exe? Editing generated code = ugh, I know, but ...

JohnC
  • 844
  • 4
  • 10
  • Ya right now i am doing that so that i can at least continue to code on my client side, but because i am working in a team and our services are changing every day, its a headache. I was thinking if there is some flag in svcutil which can help but couldn't find one – user1662008 Jun 18 '14 at 16:20
0

Take a look at the advanced settings, and you can change the collection type there:

enter image description here

I got this image from https://i.stack.imgur.com/bkwoc.png

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82