Beispiel #1
0
        /// <summary>
        /// Attempts to load the tracked message regardless from the given spool.
        /// Returns null if no message was found.
        /// </summary>
        /// <param name="messageId">The message id.</param>
        /// <param name="spoolId">The spool id.</param>
        public BizTalkTrackedMessage LoadTrackedMessage(Guid messageId, int spoolId)
        {
            if (spoolId < 1 || spoolId > 2)
            {
                throw new ArgumentOutOfRangeException("spoolId", "must be 1 or 2");
            }

            if (messageId == Guid.Empty)
            {
                throw new ArgumentException("Message Id cannot be Guid.Empty; use LoadTrackedMessages to load all messages", "messageId");
            }

            BizTalkTrackedMessage message = null;

            foreach (var m in LoadTrackedMessages(messageId, spoolId))
            {
                if (message != null)
                {
                    throw new InvalidOperationException("Got more than one message for guid");
                }

                message = m;
            }

            return(message);
        }
Beispiel #2
0
        /// <summary>
        /// Given a data record; tranform that record into a message.
        /// </summary>
        protected BizTalkTrackedMessage DeserializeMessageFromRecord(IDataRecord record, int spoolId)
        {
            //// ? uidMsgID                             ?    nNumParts uidBodyPartID
            //// 1 354AD565-9816-4D58-B55F-0B0A65792B1D NULL 1         2B38B8C9-4A4F-4343-8DE7-6549AECD7D4B

            var message = new BizTalkTrackedMessage(this, spoolId);

            message.MessageId  = record.GetGuid(1);
            message.PartCount  = record.GetInt32(3);
            message.BodyPartId = record.GetGuid(4);

            return(message);
        }
Beispiel #3
0
        /// <summary>
        /// Given a data record; tranform that record into a message.
        /// </summary>
        protected BizTalkTrackedMessage DeserializeMessageFromRecord(IDataRecord record, int spoolId)
        {
            //// ? uidMsgID                             ?    nNumParts uidBodyPartID
            //// 1 354AD565-9816-4D58-B55F-0B0A65792B1D NULL 1         2B38B8C9-4A4F-4343-8DE7-6549AECD7D4B

            var message = new BizTalkTrackedMessage(this, spoolId);

            message.MessageId = record.GetGuid(1);
            message.PartCount = record.GetInt32(3);
            message.BodyPartId = record.GetGuid(4);

            return message;
        }