コード例 #1
0
        //[OperationBehavior]
        public UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTOData DoEx(ICommonDataContract commonData, System.Int64 wSLogID)
        {
            this.CommonData = commonData;
            try
            {
                BeforeInvoke("UFIDA.U9.Cust.Pub.WSLogBP.DoRequestBP");
                DoRequestBP objectRef = new DoRequestBP();

                objectRef.WSLogID = wSLogID;

                //处理返回类型.
                UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTO result = objectRef.Do();

                if (result == null)
                {
                    return(null);
                }
                UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTOData resultdata = result.ToEntityData();
                DoSerializeKey(resultdata, "UFIDA.U9.Cust.Pub.WSLogBP.DoRequestBP");
                return(resultdata);
            }
            catch (System.Exception e)
            {
                DealException(e);
                throw;
            }
            finally
            {
                FinallyInvoke("UFIDA.U9.Cust.Pub.WSLogBP.DoRequestBP");
            }
        }
コード例 #2
0
        public override object Do(object obj)
        {
            DoRequestBP bpObj = (DoRequestBP)obj;

            if (bpObj.WSLogID <= 0)
            {
                throw new BpParameterException("DoRequestBP", "WSLogID");
            }
            WSLog wsLog = WSLog.Finder.FindByID(bpObj.WSLogID);

            if (wsLog == null)
            {
                throw new Exception(string.Format("未找到对应ID:{0}的WSLog实体", bpObj.WSLogID));
            }
            if (wsLog.CallResult == CallResultEnum.Success)
            {
                throw new Exception("已执行成功,不允许重复执行");
            }
            string           url       = AddLogIDInUrl(wsLog.RequestUrl, wsLog.ID);
            RequestResultDTO resultDTO = new RequestResultDTO();

            resultDTO.WSLogID = wsLog.ID;
            //调用服务
            CallWebService(url, wsLog.RequestContent, resultDTO);
            return(resultDTO);
        }