///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中下划线部分提示错误参数请各位高手赐教!

解决方案 »

  1.   

    在WCF中,在Client生成的代理类中默认的会把List<T>类型转换为T[],所以
    accServiceClient.SaverbuspointsAsync(buspoints[] bs);   其实它的参数类型为buspoints[]集合。可以用如下的方式来改变:
    在Client端的WCF的引用上,点击右键 -> Configuare Servie Reference -> 修改Collection type一项 即可。
      

  2.   

    WCF中默认以数组形式传递
    如果你没改默认配置的话,问题出在参数类型上。把list转换成数组就可以了
      

  3.   

    当然你可以这样写:accServiceClient.SaverbuspointsAsync(listbuspoints.ToArray()); 
      

  4.   

    好象不好用啊!
    system.Collections.ObjectModel.Collection
    对吗?
      

  5.   

                        accServiceClient.SaverbuspointsAsync(listbuspoints.ToArray<buspoints>());