我有一个webservice,有这个定义的类:
[Serializable]
public class Parameter
{
public Parameter()
{
}
public List<MyObject> list { get; set; }
}
好吧,在另一个项目/ webservice上,我通过discomap / wsdl导入引用,我写了这个:
[WebMethod(EnableSession = true)]
public void UpdateOrdineFoto(List<MyObject> list)
{
Parameter par = new Parameter();
par.list = list;
}
但它说“无法在System.Collections.Generic.List<MyClass.MyObject>
和MyClass.MyObject[]
这意味着什么?两者都使用System.Collections.Generic;
并且是List<MyObject>
...
答案 0 :(得分:2)
我猜你是使用某种工具(添加WebReference或其他东西)从WSDL创建本地模型的 - 对吗?
你得到了它 - 它将列表导入为数组 - 就是它 - 去寻找它,大多数工具让你改变它,或者你可以手动改变它。
PS:
所以你使用Add Webservice - 应该是这样的:
只需在此处更改此选项即可使用通用列表。