简体   繁体   中英

WCF : Why I can't send a List of objects to my webservice

I build a List of objects: List<Mandat>

And I call my webservice Like these:

ServiceGestionClient svc = new ServiceGestionClient();
svc.setNewMandatImage(listMandat);

In my Webservice I have these:

public void setNewMandatImage(List<Mandat> mi)

But i have These error:

Unable to convert from list<Mandat> to mandat[]

Why does he try to convert as an array?

The reason is that WCF serializes the universal list into an array to send over the.network. The configuration just tells svcutil to create a proxy and convert them back to a common list for convenience.

solution:

Set in the Add Service Reference tool:

在此处输入图像描述

在此处输入图像描述

Finally, apply this setting to generate a proxy class.

Feel free to let me know if the problem persists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM