///web service
    
[OperationContract]
    void Saverbuspoints(List<buspoints> listbuspoints);
////调用代码
        Service1Client accServiceClient = new Service1Client();
        List<buspoints> listbuspoints = new List<buspoints>();....                    accServiceClient.SaverbuspointsAsync(listbuspoints);如何将泛类型传递到web service中下划线部分提示错位参数请各位高手赐教!

解决方案 »

  1.   

    如webServer的命名空間為webServer.LocalhostwebServer.localhost.buspoints  bus=new webServer.localhost.buspoints();listBuspoints.add(bus);accserviceClient.saverbuspointsSsync(listBuspoints);
      

  2.   

    这个数据我都添加了!但是往服务里添加的时候listbuspoints提示参数错误这样添加不是没有问题吗!但是为什么会有这样的错误提示
      

  3.   

    这个数据我都添加了!但是往服务里添加的时候listbuspoints提示参数错误这样添加不是没有问题吗!但是为什么会有这样的错误提示
      

  4.   

    怎么做,但是我的服务是List <buspoints>这样的泛类型啊!能接收吗?!请给出实例好吗?
      

  5.   

    namespace Model
    {
       [Serializable]
       public class MAX
       {   }
    }namespace WebService1
    {
       /// <summary>
       ///Service1 的摘要描述
       /// </summary>
       [WebService(Namespace = "http://tempuri.org/")]
       [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
       [ToolboxItem(false)]
       public class Service1 : System.Web.Services.WebService
       {      [WebMethod]
          public string HelloWorld(List<MAX> objes)
          {
             return "Hello World";
          }
       }
    }namespace WindowsApplication1
    {
       public partial class Form1 : Form
       {
          public Form1()
          {
             InitializeComponent();
          }      private void button1_Click(object sender, EventArgs e)
          {
             localhost.Service1 k = new WindowsApplication1.localhost.Service1();
             WindowsApplication1.localhost.MAX d = new WindowsApplication1.localhost.MAX();
             List<WindowsApplication1.localhost.MAX> t = new List<WindowsApplication1.localhost.MAX>();
             t.Add(d);
             MessageBox.Show(k.HelloWorld(t.ToArray()));        
          }      private void Form1_Load(object sender, EventArgs e)
          {
             
          }
       }
    }
      

  6.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.Text;// 注意: 如果更改此处的接口名称 "IService1",也必须更新 Web.config 中对 "IService1" 的引用。
    [ServiceContract]
    public interface IService1
    {
        //buspoints表内容
        [OperationContract]
        List<buspoints> GetAllBuspoints(string strname);    [OperationContract]
        void Saverbuspoints(buspoints listbuspoints);    [OperationContract]
        List<BusSite> GetAllBusSite(string strname);
    }这样的特性也好用吗?!
      

  7.   

    老兄,我也正在試怎麼轉用接口,對這個webServer我是菜鳥.剛學,我都一直做winform的,無聊時才試試這個我幫不了你了,呵呵