Ejemplo n.º 1
0
        private string SFExpressQuery(string requestXml)
        {
            string          host   = AppSettingManager.GetSetting("SO", "SFExpressQueryHost");
            string          action = AppSettingManager.GetSetting("SO", "SFExpressAction");
            WebServiceProxy wsd    = new WebServiceProxy(host, action);

            object[] paramArray = { requestXml };

            return(wsd.ExecuteQuery(action, paramArray).ToString());
        }
 public object ExecuteQuery(string methodName, object[] param)
 {
     try
     {
         return(_proxy.ExecuteQuery(methodName, param));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public string CallUnknowWebService(string url, string method, string[] param)
 {
     try
     {
         var proxy = new WebServiceProxy(url, method);
         return((string)proxy.ExecuteQuery(method, param));
     }
     catch (Exception ex)
     {
         throw new Exception("调用WebService" + method + "失败" + ex.Message);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 动态生成代理类 方法六
 /// </summary>
 public static void TestDynamic(string url, X509Certificate[] x509CertificateArray)
 {
     try
     {
         WebServiceProxy wsp      = new WebServiceProxy(url, x509CertificateArray);
         object[]        objArray = { "小王", "" };
         //object[] objArray =  { "1", "1001", "2014110600","","","","","","","","",
         //    "","","","","","","",""};
         object responseString = wsp.ExecuteQuery("Test", objArray);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public override Patient_DTO GetPatient(string patientId)
 {
     try
     {
         Trace.WriteLine(string.Format("开始获取病人{0}的信息", patientId));
         Trace.WriteLine(string.Format("获取病人信息地址为{0}", Config.HttpConfigModel.PatientUrl));
         var      proxy   = new WebServiceProxy(Config.HttpConfigModel.PatientUrl, Config.HttpConfigModel.WebServiceName);
         string[] param   = { ClientConstants.KR_GET_PATIENT, patientId };
         var      jsonStr = (string)proxy.ExecuteQuery(Config.HttpConfigModel.WebServiceName, param);
         Trace.WriteLine(string.Format("获取病人信息为{0}", jsonStr));
         return(CommunicationHelper.DeserializeJsonToObj <Patient_DTO>(jsonStr));
     }
     catch (KRException ex)
     {
         throw new Exception("获取病人信息失败" + ex.Msg);
     }
 }
Ejemplo n.º 6
0
        public override KRResponse PostExamResult(ExamResultMetadata <T> result)
        {
            try
            {
                var      resultStr = CommunicationHelper.SerializeObjToJsonStr(result);
                string[] param     = { ClientConstants.KR_POST_RESULT, resultStr };
                var      proxy     = new WebServiceProxy(Config.HttpConfigModel.PostCheckResultUrl, Config.HttpConfigModel.WebServiceName);
                Trace.WriteLine(string.Format("开始发送检查结果,地址为{0}", Config.HttpConfigModel.PostCheckResultUrl));
                var response = (string)proxy.ExecuteQuery(Config.HttpConfigModel.WebServiceName, param);
                Trace.WriteLine(string.Format("开始发送检查结果结束,返回结果{0}", resultStr));

                return(CommunicationHelper.DeserializeJsonToObj <KRResponse>(response));
            }
            catch (KRException ex)
            {
                throw new Exception("上传检查结果失败 " + ex.Msg);
            }
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            //var client = new WebServiceProxy("http://localhost:7100/KaiHuaWebService.asmx/GetPatPacsResultInfo");
            var    client = new WebServiceProxy("http://localhost:7100/KaiHuaWebService.asmx?wsdl", "GetPatPacsResultInfo");
            Person p      = new Person()
            {
                Name   = "Gua",
                Age    = 11,
                Gender = "驴"
            };
            var param = JsonConvert.SerializeObject(p);
            var model = new object[2] {
                "700001", param
            };
            var result = client.ExecuteQuery("GetPatPacsResultInfo", model);

            Console.WriteLine(result);
            Console.ReadKey();
        }