ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportGet MQ queue names problem: Index and count must refer to

Post new topicReply to topic
Get MQ queue names problem: Index and count must refer to View previous topic :: View next topic
Author Message
embryo
PostPosted: Wed Jan 20, 2016 1:37 am Post subject: Get MQ queue names problem: Index and count must refer to Reply with quote

Newbie

Joined: 20 Jan 2016
Posts: 2

Hi everyone!

My code:
Code:

public List<string> GetALLQueue(string qmName, bool isFindSystemQueue = false)

    {

        PCFMessageAgent agent = new PCFMessageAgent(qmName);

        PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);

        request.AddParameter(MQC.MQCA_Q_NAME, "*");

        PCFMessage[] response = agent.Send(request);

        string[] names = response[0].GetStringListParameterValue(CMQCFC.MQCACF_Q_NAMES);

        List<string> result = null;

        if (!isFindSystemQueue)

            result = names.ToList().Where(s => !s.Contains("AMQ.") && !s.Contains("SYSTEM.")).ToList();

        else

            result = names.ToList();

        return result;

    }


The error is "Index and count must refer to a location within the buffer." in code
Code:
PCFMessage[] response = agent.Send(request);
.

MQ version is Websphere MQ 7.5.0.5.
Language is c# and Framework 4.5.

Any ideas what i am doing wrong?

Regrds
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 20, 2016 5:42 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19084
Location: LI,NY

Did you check the reason code on response?
Did you check if response was null?
What else could need checking that you are bypassing happily?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
embryo
PostPosted: Wed Jan 20, 2016 5:30 pm Post subject: Reply with quote

Newbie

Joined: 20 Jan 2016
Posts: 2

fjb_saper wrote:
Did you check the reason code on response?
Did you check if response was null?
What else could need checking that you are bypassing happily?


Thank you for your prompt reply.
I already checked reason code.
No response was received from AMQERR01.LOG
I am a new user.
Im clueless what I should check.
Could you tell me? Thank you!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 20, 2016 5:58 pm Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19084
Location: LI,NY

embryo wrote:
fjb_saper wrote:
Did you check the reason code on response?
Did you check if response was null?
What else could need checking that you are bypassing happily?


Thank you for your prompt reply.
I already checked reason code.
No response was received from AMQERR01.LOG
I am a new user.
Im clueless what I should check.
Could you tell me? Thank you!

Your code does not say so. You retrieve an array of PCF messages, but you do not check if the array is empty... and then you merrily and happily look at the first message in the array....

Should that message exist (probably not given the error you are receiving) you go to check its content without examining the reason code / return code it holds... first...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportGet MQ queue names problem: Index and count must refer to
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.