title: How to pass authentication info when using Messsage Service Client for .net to connect to IBM WMQ
body: <p>We are developing a console application using c# to access IBM WMQ.  We are using IBM Message Service Client for .net (XMS) and WebSphere MQ Client. Here are the code example:</p>
  
  <pre><code>            XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
              IConnectionFactory cf = xff.CreateConnectionFactory();
              cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "host");
              cf.SetIntProperty(XMSC.WMQ_PORT, 1445);
              cf.SetStringProperty(XMSC.WMQ_CHANNEL, "channel");
              cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
              cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "queueManager");
              cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
              cf.SetStringProperty(XMSC.USERID, @"userid");
              cf.SetStringProperty(XMSC.PASSWORD, @"");
  
              IConnection conn = cf.CreateConnection();
              conn.ExceptionListener = new ExceptionListener(OnXMSExceptionReceived);
              Console.WriteLine("connection created");
              ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
  </code></pre>
  
  <p>We kept getting the following error:
               CWSMQ0044E: The user is not authorized to connect to the queue manager. The   application has tried to connect to a queue manager without authorization. Ensure th
  at appropriate authority exists on the queue manager for this user.</p>
  
  <p>But we have no problem to access the same MQ using spring integration.  here is the settings for spring integration:</p>
  
  <pre><code>&lt;bean id="connectionFactoryWBI" class="com.ibm.mq.jms.MQQueueConnectionFactory"&gt;
      &lt;property name="hostName" value="${hostName}" /&gt;
      &lt;property name="port" value="${port}" /&gt;
      &lt;property name="queueManager" value="${queueManager}" /&gt;
      &lt;property name="channel" value="${channel}" /&gt;
      &lt;property name="transportType" value="1" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="connectionFactoryWBIWithCredentials" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"&gt;
      &lt;property name="targetConnectionFactory" ref="connectionFactoryWBI" /&gt;
      &lt;property name="username" value="${username}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I am new to XMS and .net,  do not know how to pass the authentication info for connecting to MQ.  any recommendations are highly welcome! </p>