Example #1
0
        protected MQMessage[] Send(int command, PCFParameter[] parameters)
        {
            if (parameters == null)
            {
                throw new Exception("Must specify parameters!");
            }
            MQQueue   queue   = this.qMgr.AccessQueue("SYSTEM.DEFAULT.MODEL.QUEUE", 0x2021);
            MQMessage message = new MQMessage();

            message.ReplyToQueueName = queue.Name;
            message.MessageType      = 1;
            message.Feedback         = 0;
            message.Format           = "MQADMIN ";
            message.Report           = 0;
            MQCFH.Write(message, command, parameters.Length);
            for (int i = 0; i < parameters.Length; i++)
            {
                parameters[i].Write(message);
            }
            MQQueue             queue2 = this.qMgr.AccessQueue(this.qMgr.CommandInputQueueName, 0x2030);
            MQPutMessageOptions pmo    = new MQPutMessageOptions();

            pmo.Options = 0x40;
            queue2.Put(message, pmo);
            MQGetMessageOptions gmo = new MQGetMessageOptions();

            gmo.Options      = 0x2001;
            gmo.WaitInterval = this.waitInterval;
            gmo.MatchOptions = 2;
            ArrayList list     = new ArrayList();
            MQMessage message2 = null;
            int       compCode = 0;
            int       reason   = 0;
            int       num4     = 1;

            do
            {
                message2 = new MQMessage();
                message2.CorrelationId = message.MessageId;
                queue.Get(message2, gmo);
                message2.SkipBytes(20);
                num4     = message2.ReadInt4();
                compCode = message2.ReadInt4();
                reason   = message2.ReadInt4();
                message2.Seek(0);
                if (compCode != 0)
                {
                    throw new PCFException(compCode, reason);
                }
                list.Add(message2);
            }while (num4 == 0);
            queue2.Close();
            queue.Close();
            return((MQMessage[])list.ToArray(typeof(MQMessage)));
        }
Example #2
0
        internal override sealed void Initialize(MQMessage message)
        {
            base.Type         = message.ReadInt4();
            base.StrucLength  = message.ReadInt4();
            base.Parameter    = message.ReadInt4();
            this.stringLength = message.ReadInt4();
            this.byteVal      = message.ReadBytes(this.stringLength);
            int padding = (4 - ((Cmqcfc.MqcfbsStrucLengthFixed + this.stringLength) % 4)) % 4;

            message.SkipBytes(padding);
        }
Example #3
0
        internal override sealed void Initialize(MQMessage message)
        {
            Type           = message.ReadInt4();
            StrucLength    = message.ReadInt4();
            Parameter      = message.ReadInt4();
            CodedCharSetId = message.ReadInt4();
            _stringLength  = message.ReadInt4();
            _stringval     = message.ReadString(_stringLength); //  Encoding.ASCII.GetString(message.ReadBytes(_stringLength), 0, _stringLength);
            var padding = (4 - ((Cmqcfc.MqcfstStrucLengthFixed + _stringLength) % 4)) % 4;

            message.SkipBytes(padding);
        }
Example #4
0
        public override void Initialize(MQMessage message)
        {
            base.type           = message.ReadInt4();
            base.strucLength    = message.ReadInt4();
            base.parameter      = message.ReadInt4();
            this.codedCharSetId = message.ReadInt4();
            this.stringLength   = message.ReadInt4();
            this.stringval      = Encoding.ASCII.GetString(message.Read(this.stringLength), 0, this.stringLength);
            int n = (4 - ((20 + this.stringLength) % 4)) % 4;

            message.SkipBytes(n);
        }
        internal override bool IsLast(MQMessage message)
        {
            message.SkipBytes(20);
            var end      = message.ReadInt4() != 0;
            var compCode = message.ReadInt4();
            var reason   = message.ReadInt4();

            message.Seek(0);
            if (compCode != 0)
            {
                throw new PcfException(compCode, reason);
            }
            return(end);
        }
Example #6
0
        internal override sealed void Initialize(MQMessage message)
        {
            Type        = message.ReadInt4();
            StrucLength = message.ReadInt4();
            Parameter   = message.ReadInt4();
            _count      = message.ReadInt4();
            _values     = new int[_count];
            for (var i = 0; i < _count; i++)
            {
                _values[i] = message.ReadInt4();
            }
            var n = (4 - (StrucLength % 4)) % 4;

            message.SkipBytes(n);
        }
Example #7
0
        public override void Initialize(MQMessage message)
        {
            base.type        = message.ReadInt4();
            base.strucLength = message.ReadInt4();
            base.parameter   = message.ReadInt4();
            this.count       = message.ReadInt4();
            this.values      = new int[this.count];
            for (int i = 0; i < this.count; i++)
            {
                this.values[i] = message.ReadInt4();
            }
            int n = (4 - (base.strucLength % 4)) % 4;

            message.SkipBytes(n);
        }
Example #8
0
        public override void Initialize(MQMessage message)
        {
            base.type           = message.ReadInt4();
            base.strucLength    = message.ReadInt4();
            base.parameter      = message.ReadInt4();
            this.codedCharSetId = message.ReadInt4();
            this.count          = message.ReadInt4();
            this.stringLength   = message.ReadInt4();
            this.strings        = new string[this.count];
            for (int i = 0; i < this.count; i++)
            {
                this.strings[i] = Encoding.ASCII.GetString(message.Read(this.stringLength), 0, this.stringLength);
            }
            int n = (4 - (base.strucLength % 4)) % 4;

            message.SkipBytes(n);
        }
Example #9
0
        internal override sealed void Initialize(MQMessage message)
        {
            Type           = message.ReadInt4();
            StrucLength    = message.ReadInt4();
            Parameter      = message.ReadInt4();
            CodedCharSetId = message.ReadInt4();
            _count         = message.ReadInt4();
            _stringLength  = message.ReadInt4();
            _strings       = new string[_count];
            for (var i = 0; i < _count; i++)
            {
                _strings[i] = message.ReadString(_stringLength); // Encoding.ASCII.GetString(message.ReadBytes(_stringLength), 0, _stringLength);
            }
            var padding = (4 - (StrucLength % 4)) % 4;

            message.SkipBytes(padding);
        }