Using generic collections as parameters in ASMX web services

不打扰是莪最后的温柔 提交于 2019-12-01 08:54:37

问题


I have an ASMX web service which has a method -

void DoSomething(List<string> list);

I have implemented this service, compiled and hosted in IIS. I used wsewsdl3.exe to generate the proxy. In the generated proxy the method definition is changed to -

DoSomething(string[] list) { ..

Is it not possible to have List as a parameter to an ASMX web service? What should I do to fix the proxy?


回答1:


That's normal. Generics are a .NET specific artifact. There's no such notion in the generated WSDL. Imagine a client which doesn't support generics like PHP for example. That's the reason why your generic collection is exposed as an array. So there's nothing wrong with your client proxy that requires fixing.



来源:https://stackoverflow.com/questions/4254223/using-generic-collections-as-parameters-in-asmx-web-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!