예제 #1
0
        /// <summary>
        /// 调用web服务
        /// </summary>
        /// <param name="url">服务地址</param>
        /// <param name="classname">类名</param>
        /// <param name="methodname">方法名</param>
        /// <param name="args">参数</param>
        /// <returns>返回结果</returns>
        public static object InvokeWebService(string url, string classname, string methodname, object[] args)
        {
            if ((classname == null) || (classname == ""))
            {
                classname = WebServiceHelper.GetWsClassName(url);
            }

            try
            {
                object obj = GetClassInstance(url, classname);

                return(InvokeWebService(obj, methodname, args));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.Message, new Exception(ex.InnerException.StackTrace));
            }
        }
예제 #2
0
 public static object InvokeWebService1(string url, string methodname, params object[] args)
 {
     return(WebServiceHelper.InvokeWebService(url, null, methodname, args));
 }