<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ronak Padaliya</title>
    <description>The latest articles on DEV Community by Ronak Padaliya (@ronakpadaliya).</description>
    <link>https://dev.to/ronakpadaliya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3198496%2F27c51623-b4a5-4f0c-8a82-5dd6c0c9a7ae.jpg</url>
      <title>DEV Community: Ronak Padaliya</title>
      <link>https://dev.to/ronakpadaliya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ronakpadaliya"/>
    <language>en</language>
    <item>
      <title>Getting MQ Exception: MQRC_NOT_AUTHORIZED</title>
      <dc:creator>Ronak Padaliya</dc:creator>
      <pubDate>Fri, 23 May 2025 06:29:12 +0000</pubDate>
      <link>https://dev.to/ronakpadaliya/getting-mq-exception-mqrcnotauthorized-90k</link>
      <guid>https://dev.to/ronakpadaliya/getting-mq-exception-mqrcnotauthorized-90k</guid>
      <description>&lt;p&gt;I have installed IBM MQ and IBM MQ Explorer by using the below steps mentioned in the PDF file,&lt;a href="https://learn-attachment.microsoft.com/api/attachments/2e24c83b-0ee3-44bf-bed6-abab9bffe3e9?platform=QnA" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, I want to access the queues list from a C# console app (.NET Core 8.0) as below,&lt;/p&gt;

&lt;p&gt;`using IBM.WMQ;&lt;br&gt;
using IBM.WMQ.PCF;&lt;br&gt;
using System.Collections;&lt;/p&gt;

&lt;p&gt;namespace IBM_MQ_Testing&lt;br&gt;
{&lt;br&gt;
    public class Program&lt;br&gt;
    {&lt;br&gt;
        public static void Main(string[] args)&lt;br&gt;
        {&lt;br&gt;
            string queueManagerName = "QManager01";&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        Hashtable connectionProperties = new Hashtable
        {
            { MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },
            { MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.SVRCONN" },
            { MQC.HOST_NAME_PROPERTY, "YOUR-PC-NAME" }, // Or your machine name or IP
            { MQC.PORT_PROPERTY, 1414 },
        };

        try
        {
            MQQueueManager queueManager = new MQQueueManager(queueManagerName, connectionProperties);
            Console.WriteLine($"Connected to Queue Manager: {queueManager.Name}");

            // Create PCF message agent
            IBM.WMQ.PCF.MQCFH header = new IBM.WMQ.PCF.MQCFH(IBM.WMQ.PCF.CMQCFC.MQCFC_LAST, IBM.WMQ.PCF.CMQCFC.MQCMD_INQUIRE_Q_NAMES);
            IBM.WMQ.PCF.PCFMessageAgent agent = new IBM.WMQ.PCF.PCFMessageAgent(queueManager);

            // Create PCF request
            IBM.WMQ.PCF.PCFMessage request = new IBM.WMQ.PCF.PCFMessage(IBM.WMQ.PCF.CMQCFC.MQCMD_INQUIRE_Q_NAMES);
            request.AddParameter(MQC.MQCA_Q_NAME, "*"); // Wildcard for all queues

            // Send PCF request
            IBM.WMQ.PCF.PCFMessage[] responses = agent.Send(request);

            foreach (IBM.WMQ.PCF.PCFMessage response in responses)
            {
                string[] queueNames = (string[])response.GetParameterValue(MQC.MQCACF_Q_NAMES);
                foreach (var name in queueNames)
                {
                    Console.WriteLine("Queue: " + name.Trim());
                }
            }

            queueManager.Disconnect();
        }
        catch (MQException mqe)
        {
            Console.WriteLine($"MQ Exception: {mqe.Message}, Reason Code: {mqe.ReasonCode}");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
        }

        Console.ReadLine();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

&lt;p&gt;But when I run the above console app from Visual Studio 2022 in ADMINISTRATION mode, it throws the following error,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1o63l07y2yv7k7zmgra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1o63l07y2yv7k7zmgra.png" alt="Image description" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't know what's wrong with it. It's great to give any ideas or suggestions that work. 😊&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>ibm</category>
      <category>netcore</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
