Beispiel #1
0
        /// <summary>
        /// 验证签名
        /// </summary>
        private void validateSign()
        {
            var signContent = Context.UserName + InterfaceSetting.SecurityCode + Context.Service + (Context.Params == null ? string.Empty : Context.Params.InnerXml);
            var signValue   = Utility.MD5EncryptorService.MD5(signContent).ToUpper();

            if (signValue != Context.Sign)
            {
                InterfaceInvokeException.ThrowSignErrorException();
            }
        }
Beispiel #2
0
 /// <summary>
 /// 验证访问权限
 /// </summary>
 private void validatePermission()
 {
     // 是否有权限访问
     if (InterfaceSetting.BindIP != Context.ClientIP)
     {
         InterfaceInvokeException.ThrowNoAccessException();
     }
     if (InterfaceSetting.InterfaceInvokeMethod == null || !InterfaceSetting.InterfaceInvokeMethod.Contains(Context.Service))
     {
         InterfaceInvokeException.ThrowNoAccessException();
     }
 }
Beispiel #3
0
 public static XmlDocument Format(InterfaceInvokeException exception)
 {
     return(Format(exception.Code, exception.Parameter, string.Empty));
 }