大家看下这个帖子谢谢客户端不是直接调用webservice,中间还有个代理类,这个类负责动态编译调用webservice。客户端调用的是代理类http://topic.csdn.net/u/20100527/09/2eaa6369-ae2d-436c-aabc-ed62205ebf87.html?seed=1196885703&r=65754919#r_65754919

解决方案 »

  1.   

    设置.config文件,在这个文件里去读取调用你要使用的webservice
      

  2.   

    web service 的方法参数中不能用out类型
      

  3.   

    可以的    [WebMethod]
        public string HelloWorld(out string result) {
            result = "result";
            return "Hello World";
        }
                string msg;
                string result;
                localhost.WebService w = new WindowsApplication1.localhost.WebService();
                msg= w.HelloWorld(out result);
                MessageBox.Show(msg);
                MessageBox.Show(result);
      

  4.   

    反射调用带ref或out参数的方法时,需要精确指定type的个数与类型
     System.Reflection.MethodInfo mi = t.GetMethod(methodname);
     System.Reflection.MethodInfo mi = t.GetMethod(methodname,new Type[]
      {
      Type.GetType("System.Int32"),
      Type.GetType("System.Int32&") //这个是out参数
      }
    );
    修改代理类
      public static object InvokeWebService(string url, string classname, string methodname, object[] args,param Type[] types)