///web service
//为WCF服务
[OperationContract]
void Saverbuspoints(List <buspoints> listbuspoints);
////调用代码
Service1Client accServiceClient = new Service1Client();
List <buspoints> listbuspoints = new List <buspoints>();
为listbuspoints此对象添加了数据。.... accServiceClient.SaverbuspointsAsync(listbuspoints); 如何将泛类型传递到web service中下划线部分提示错误参数请各位高手赐教!
//为WCF服务
[OperationContract]
void Saverbuspoints(List <buspoints> listbuspoints);
////调用代码
Service1Client accServiceClient = new Service1Client();
List <buspoints> listbuspoints = new List <buspoints>();
为listbuspoints此对象添加了数据。.... accServiceClient.SaverbuspointsAsync(listbuspoints); 如何将泛类型传递到web service中下划线部分提示错误参数请各位高手赐教!
accServiceClient.SaverbuspointsAsync(buspoints[] bs); 其实它的参数类型为buspoints[]集合。可以用如下的方式来改变:
在Client端的WCF的引用上,点击右键 -> Configuare Servie Reference -> 修改Collection type一项 即可。
如果你没改默认配置的话,问题出在参数类型上。把list转换成数组就可以了
system.Collections.ObjectModel.Collection
对吗?