473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to connect to MQ on unix from .NET application?

Hi,
Am writing an .net windows application in which i have to connect to IBM MQ on remote machine running unix to post messages. This is a tool kinda thing for an enterprise application.

this is the code am using to connect to the MQ.

Expand|Select|Wrap|Line Numbers
  1. MQEnvironment.Hostname = hostName;
  2. MQEnvironment.Port = port;
  3. MQEnvironment.Channel = "SYSTEM.DEF.SVRCONN";
  4. MQQueueManager qm=new MQQueueManager(queueMgr);
When i try to run the application it throws an exception in
MQQueueManager qm=new MQQueueManager(queueMgr);

Exception details :- CompCode 2 Reason 2035 ..from error code lookup i learnt that its MQRC_NOT_AUTHORIZED.
read somewhere that the user's credentials under whom application is run will be supplied for authorization automatically..if thats the case how is cross platform connectivity is possible...in my case mq client is on windows and
mq server is on unix.

Do i have to specify the userid,password for unix system to override this?
If so, how? MQQueueManager Class doesnt have a constructor that accepts userid/password as a parameter and MQEnvironment doesnt have a property for userid/password..
Am using Websphere Mq 5.3 ? Is the option to specify userid/password available in the latest version 6.0?

seems MQ classes for java have options to specify userid/password but .NET classes didnt.

am pulling my hair over this for the past 3 days...please help..
Jul 12 '07 #1
1 6526
I found that in V6 and V7 of the MQ Messaging Library for .NET, the readme file states:

(WMQ) User authentication for WMQ is performed by using the details of the
logged on user and not the information provided in the XMSC.USERID and
XMSC.PASSWORD fields. This is the current design intention for consistency
with WMQ. Please see the WMQ user documentation for further details of
authentication.

I found that if you "impersonate" a windows user at runtime that is the same username of the MQ server before creating the MQQueueManager, it works!

By adjusting this sample code from MS (http://support.microsoft.com/kb/306158) you can easily accomplish the impersonation.

I hope this helps others!

Derek Wade
Oct 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dmitry Akselrod | last post by:
Hello everyone, I have a vb.net application that wraps the TCPListener object in a class. The server connects to the local interface and establishes itself on port 9900. It then polls for...
3
by: W Akthar | last post by:
Hi I am trying to create a windows service which queries SQL Server on timed intervals and depending on the results send appointments to Outlook. The problem lies when I try to create an...
6
by: Alexander Cohen | last post by:
Im trying to connect locally to a database on a running postgres cluster. If i connect with psql, everything is fine and i can transact. I i try and connect in my own app, i get this error: ...
11
by: zaebos | last post by:
hi, i have this code which is part of a main program, to email from within the program a log file: int MailIt (char *mailserver, char *emailto, char *emailfrom, char *emailsubject, char...
0
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
6
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005, .net 2.0 and created a stand-alone windows application. I need to connect to Unix server on the network to read in a couple of files from it. I also am required to provide...
10
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
2
by: orandov | last post by:
Hi, I am having a problem connecting my .net applications from the application server to the database server. When I run the application from my windows xp (sp2) box it works fine. When I try to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.