user1662008
user1662008

Reputation: 307

WCF proxy convert List<string[]> to List<List<string>>

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

Upvotes: 1

Views: 497

Answers (3)

Christian Phillips
Christian Phillips

Reputation: 18769

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.sstatic.net/bkwoc.png

Upvotes: 0

Aditya Patil
Aditya Patil

Reputation: 558

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

Upvotes: 1

JohnC
JohnC

Reputation: 842

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

Upvotes: 0

Related Questions