I have web service that should receive param ArrayList
[WebMethod]
public void SelectPatches(ArrayList selectedPatches){}
But when I call this method from client Visual Studio return error:
Cannot convert from 'System.Collections.ArrayList' to 'object[]'
Is it possible to pass parameter with type ArrayList to Web Service?
Don't use non-generic collections. Use generic, at least List<object>
.
Web method should accept array of any type, thus use ToArray()
extension method.
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.