Exemple #1
0
        public RejectMessage(string messageTypeRejected, RejectCode rejectionCode, string rejectionReason, byte[] extraData) : base("reject")
        {
            RejectionCode       = (Byte)rejectionCode;
            MessageTypeRejected = messageTypeRejected;
            RejectionReason     = rejectionReason;
            ExtraData           = extraData;

            createRejectPayload();
        }
Exemple #2
0
			bool DoS(int level, bool ret = false,
			 RejectCode chRejectCodeIn = 0, string strRejectReasonIn = "",
			 bool corruptionIn = false)
		{
			chRejectCode = chRejectCodeIn;
			strRejectReason = strRejectReasonIn;
			corruptionPossible = corruptionIn;
			if(mode == mode_state.MODE_ERROR)
				return ret;
			nDoS += level;
			mode = mode_state.MODE_INVALID;
			return ret;
		}
Exemple #3
0
 bool DoS(int level, bool ret       = false,
          RejectCode chRejectCodeIn = 0, string strRejectReasonIn = "",
          bool corruptionIn         = false)
 {
     chRejectCode       = chRejectCodeIn;
     corruptionPossible = corruptionIn;
     if (mode == mode_state.MODE_ERROR)
     {
         return(ret);
     }
     nDoS += level;
     mode  = mode_state.MODE_INVALID;
     return(ret);
 }
Exemple #4
0
        public ISMEV3Result SendReject(string responseTo, RejectCode rejectCode, string rejectDescription)
        {
            var result = new SMEV3Result {
                MessageId = GuidGenerator.GenerateTimeBasedGuid().ToString()
            };

            try
            {
                var senderResponseData = new SenderProvidedResponseData();
                senderResponseData.Id        = "SIGNED_BY_PROVIDER";
                senderResponseData.MessageID = result.MessageId;
                senderResponseData.To        = responseTo;

                senderResponseData.RequestRejected = new SenderProvidedResponseDataRequestRejected[]
                {
                    new SenderProvidedResponseDataRequestRejected
                    {
                        RejectionReasonCode        = rejectCode,
                        RejectionReasonDescription = rejectDescription
                    }
                };

                var request  = new SendResponse(senderResponseData, null, null);
                var smevSign = SerializeWithSign(request, "SIGNED_BY_PROVIDER");
                request.CallerInformationSystemSignature = smevSign;

                var response = smev.SendResponse(request);
                result.SoapRequest  = behavior.SoapRequest;
                result.SoapResponse = behavior.SoapResponse;
                result.Status       = SMEV3ResultStatus.OK;
            }
            catch (FaultException e)
            {
                result.SoapRequest  = behavior.SoapRequest;
                result.SoapResponse = behavior.SoapResponse;
                result.Status       = SMEV3ResultStatus.Fail;
                result.ErrorText    = e.Message;
            }
            catch (Exception e)
            {
                result.Status     = SMEV3ResultStatus.Error;
                result.ErrorText  = e.Message;
                result.ErrorText += "\n" + e.StackTrace;
            }

            return(result);
        }
Exemple #5
0
 public bool Invalid(bool ret = false,
                     RejectCode _chRejectCode = 0, string _strRejectReason = "")
 {
     return(DoS(0, ret, _chRejectCode, _strRejectReason));
 }
Exemple #6
0
		public bool Invalid(bool ret = false,
				 RejectCode _chRejectCode = 0, string _strRejectReason = "")
		{
			return DoS(0, ret, _chRejectCode, _strRejectReason);
		}
Exemple #7
0
 public RejectMessage(string messageTypeRejected, RejectCode rejectionCode, string rejectionReason)
     : this(messageTypeRejected, rejectionCode, rejectionReason, new byte[0])
 {
 }
Exemple #8
0
 internal QBitNinjaException(RejectCode code, string responseData)
     : base(code.ToString() + " : " + responseData)
 {
     ResponseData = responseData;
     Code         = code;
 }
Exemple #9
0
 public ConversationRejectMessage(RejectCode deSerializeFailed) : this()
 {
     this.deSerializeFailed = deSerializeFailed;
 }