每次调用WebService都将生成新的对象,你这样做是不行了,你可以试试在一个WebMethod完成处理

解决方案 »

  1.   

    我先在客户端生成了一个代理对象了啊,这样不行啊
    在同一个webmethod中太浪费效率了,没有办法可以重复使用上个web method中生成的对象么
      

  2.   

    agree with yqdeng, every time you invoke a web method, a new instance of webservice class is created>>>>在同一个webmethod中太浪费效率了,没有办法可以重复使用上个web method中生成的对象么
    you could try to use a static member (threading problem) or use EnableSession and save the object in a session variable(potential threading model problem for COM object like Excel)