0

i'm trying to connect my VB.net application to Remote Queue Manager.

but keep getting the followig Erorr: MQRC_Q_MGR_NAME_ERROR. can anyone tell me what i'm doing wrong?

here is the code i'm using:

Dim mqQMgr As MQQueueManager = Nothing

            Dim props As New Hashtable()
            props.Add(MQC.HOST_NAME_PROPERTY, "192.168.28.191")
            props.Add(MQC.CHANNEL_PROPERTY, "SYSTEM.ADMIN.SVRCONN")
            props.Add(MQC.USER_ID_PROPERTY, "AQ")
            props.Add(MQC.PORT_PROPERTY, 1313)
            props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS)

          mqQMgr = New MQQueueManager("QMSEPAM", props)

i also tried differentconnection method (MQC.TRANSPORT_MQSERIES_CLIENT) and i get the following error:

"MQRC_NOT_AUTHORIZED"

Thanks in advance.

malico
  • 1

1 Answers1

0

You need to set MQC.TRANSPORT_PROPERTY property to MQC.TRANSPORT_MQSERIES_MANAGED or MQC.TRANSPORT_MQSERIES_CLIENT for connecting through TCP/IP socket to a queue manager that is running on a remote machine or on the same machine as your application . The MQC.TRANSPORT_MQSERIES_BINDINGS should be used only when the queue manager is running on the same machine as your application in which case your application would communicate with queue manager using shared memory.

The MQRC_NOT_AUTHORIZED (2035) is thrown if the user with which your application is attempting to connect to a remote queue manager does not have authority. There are multiple ways of providing access to queue manager, talk to your IBM MQ Administrator to provide you the required authority. Take a look at this link. BTW what version of MQ are you using?

Update: Two points

1) Is user AQ same as logged in user of the machine where the .NET application is running? MQ .NET v7.5 sends the logged in user id to queue manager for authorization unless you are using a security exit. If you are not using any security exit then the logged in user id must exist on remote machine and has authorizations to connect.

2) Do not add user to mqm as users in that group are blocked from connecting to queue manager by the Channel Authentication feature

There are couple of posts in SO that you can read:

WebSphere MQ v7.1 Security User Credentials

MQRC_NOT_AUTHORIZED error while connecting to Websphere MQ 7.1

Finally if you are just testing out your application and do not really need user id authorization, then you can disable channel authentication by running the below runmqsc command.

ALTER QMGR CHLAUTH (DISABLED)
Community
  • 1
  • 1
Shashi
  • 14,980
  • 2
  • 33
  • 52
  • Hello Shashi, thanks. i'm now clear about the MQC.TRANSPORT_PROPERTY_CLIENT, but i still getting the same error. i have created a user(AQ) on both server and client and added this user to Administration and mqm GRoup. i even set MCA userID for the channel: SYSTEM.ADMIN.SVRCONN. an still same error. is there anything else i should do? i'm using MQ7.5 – malico Jan 04 '15 at 07:35
  • The reason for the authorisation failure should be within the queue manager error logs (AMQERR01.LOG). You can find qmgr error logs at /path/to/qmgr/data/qmgrs/qmgr_name/errors – Tim McCormick Jan 06 '15 at 15:16