コード例 #1
0
        /// <summary>
        /// 调用WebService请求数据
        /// </summary>
        /// <param name="context"></param>
        /// <param name="action"></param>
        /// <param name="method"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        private string CallWebService(HttpContext context, string action, string method, string token)
        {
            string callBackUrl        = context.Request.Url.ToString().Substring(0, context.Request.Url.ToString().IndexOf('?') - 1) + "/CommonHandler.ashx";
            var    dicParamWebService = GetWebServiceParam(context, action, method, token, callBackUrl);

            try
            {
                string url             = AppSettingInfo.WorkflowServerUrl;
                string bizWFServiceURL = context.Request.Form["BizWFURL"];
                if (!string.IsNullOrEmpty(bizWFServiceURL))
                {
                    url = bizWFServiceURL;
                }
                string workFlowServerFullURL = SDKHelper.GetWorkflowServerUrlFullPath(url);
                var    result = SDKHelper.QueryPostWebService(workFlowServerFullURL, AppSettingInfo.CONST_WorkflowServiceMethodName, dicParamWebService);
                return(result);
            }
            catch (Exception ex)
            {
                SDKSystemSupportException newEX = new SDKSystemSupportException(ClientConstDefine.WORKFLOW_SERVICE_ERRORCODE_USERSELECT_SERVERWEBSERVICEERROR
                                                                                , ClientConstDefine.WORKFLOW_SERVICE_ERRORCONTENT_USERSELECT_SERVERWEBSERVICEERROR
                                                                                );
                throw (Exception)ex;
            }
        }
コード例 #2
0
 /// <summary>
 /// 抛异常
 /// </summary>
 /// <param name="parseExpressionResult"></param>
 /// <param name="code">异常代码值</param>
 /// <param name="message">客户端显示的异常信息,不一定是异常代码对应的信息</param>
 public static void TrueThrow(bool parseExpressionResult, int code, string message)
 {
     if (parseExpressionResult)
     {
         SDKSystemSupportException ex = new SDKSystemSupportException(code, message);
         throw (Exception)ex;
     }
 }
コード例 #3
0
        private static string CallWebService(string method, string param, string ApplyUser)
        {
            var dicParamWebService = BuildParamWebService(method, param, ApplyUser);

            try
            {
                string url = AppSettingInfo.WorkflowServerUrl;
                string workFlowServerFullURL = SDKHelper.GetWorkflowServerUrlFullPath(url);
                var    result = SDKHelper.QueryPostWebService(workFlowServerFullURL, "CommonHandler", dicParamWebService);
                return(result);
            }
            catch (Exception ex)
            {
                SDKSystemSupportException newEX = new SDKSystemSupportException(ClientConstDefine.WORKFLOW_SERVICE_ERRORCODE_USERSELECT_SERVERWEBSERVICEERROR
                                                                                , ClientConstDefine.WORKFLOW_SERVICE_ERRORCONTENT_USERSELECT_SERVERWEBSERVICEERROR
                                                                                );
                throw (Exception)ex;
            }
        }