コード例 #1
0
ファイル: IMessage.cs プロジェクト: radtek/WCF
 public virtual string ParseOutXml(Exception ex = null, bool detial = false)
 {
     if (ex != null)
     {
         ex = ex.InnerException ?? ex;
     }
     if (OutObject == null)
     {
         dynamic obj = Activator.CreateInstance(this.GetType().BaseType.GetGenericArguments()[1]);
         obj.ResultCode    = "0";
         obj.ResultContent = "成功";
         OutObject         = obj;
     }
     else
     {
         dynamic obj = (dynamic)OutObject;
     }
     if (ex != null)
     {
         if (detial)
         {
             ((dynamic)OutObject).ResultContent = ex.StackTrace;
         }
         ((dynamic)OutObject).ResultContent = ex.Message;
         ((dynamic)OutObject).ResultCode    = "-1";
     }
     return(MessageParse.GetXml(OutObject, true));
 }
コード例 #2
0
ファイル: IMessage.cs プロジェクト: radtek/WCF
 public virtual string ParseOutXml(Exception ex = null, bool detial = false)
 {
     if (ex != null)
     {
         ex = ex.InnerException ?? ex;
     }
     if (OutObject == null)
     {
         dynamic obj = Activator.CreateInstance(this.GetType().BaseType.GetGenericArguments()[1]);
         obj.OUTMSG.ERRMSG = "";
         obj.OUTMSG.ERRNO  = "0";
         OutObject         = obj;
     }
     else
     {
         dynamic obj = (dynamic)OutObject;
         obj.OUTMSG.ERRNO    = obj.OUTMSG.ERRNO ?? "0";
         obj.OUTMSG.ERRMSG   = obj.OUTMSG.ERRMSG ?? "";
         obj.OUTMSG.ERRMSGEX = obj.OUTMSG.ERRMSGEX ?? "";
     }
     if (InObject != null)
     {
         ((dynamic)OutObject).OUTMSG.ZHONGDUANLSH = ((dynamic)InObject).BASEINFO.ZHONGDUANLSH;
         ((dynamic)OutObject).OUTMSG.ZHONGDUANJBH = ((dynamic)InObject).BASEINFO.ZHONGDUANJBH;
         ((dynamic)OutObject).OUTMSG.MSGNO        = ((dynamic)InObject).BASEINFO.MSGNO;
     }
     ((dynamic)OutObject).OUTMSG.MessageID = MessageID;
     if (ex != null)
     {
         if (((dynamic)OutObject).OUTMSG.ERRNO == "-2")
         {
             if (detial)
             {
                 ((dynamic)OutObject).OUTMSG.ERRMSGEX = ex.StackTrace;
             }
             ((dynamic)OutObject).OUTMSG.ERRMSG = ex.Message;
             ((dynamic)OutObject).OUTMSG.ERRNO  = "-2";
         }
         else
         {
             if (detial)
             {
                 ((dynamic)OutObject).OUTMSG.ERRMSGEX = ex.StackTrace;
             }
             ((dynamic)OutObject).OUTMSG.ERRMSG = ex.Message;
             ((dynamic)OutObject).OUTMSG.ERRNO  = "-1";
         }
     }
     return(MessageParse.GetXml(OutObject, true));
 }
コード例 #3
0
ファイル: IMessage.cs プロジェクト: radtek/WCF
 public void ParseInXml(string xml)
 {
     InObject = MessageParse.ToXmlObject <TIN>(xml, true);
 }