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 Index » IBM MQ API Support » ASP.NET C# - MQ Client connection

Post new topic  Reply to topic
 ASP.NET C# - MQ Client connection « View previous topic :: View next topic » 
Author Message
anar
PostPosted: Tue Jun 29, 2010 4:47 am    Post subject: ASP.NET C# - MQ Client connection Reply with quote

Apprentice

Joined: 28 Jun 2010
Posts: 31

Hi.

I try the following code(figure 1) with the exception given(figure 2).

----figure_1-----------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Collections;
using IBM.WMQ;

namespace WINMQ {
public partial class Form1 : Form {
string v_qmng_str = "TST12.QUEUE.MANAGER";
string v_chnl_str = "CHL.CLI.MS.NET";
string v_prt_typ_str = "TCP";
int v_prt_int = 1415;
string v_hst_str = "172.0.0.235";
string v_usr_str = "mqm";

public Form1() {
InitializeComponent();
}

private void btn_test_Click(object sender, EventArgs e) {
try {
System.Collections.Hashtable v_qprops_hash = new System.Collections.Hashtable();
v_qprops_hash.Add(IBM.WMQ.MQC.HOST_NAME_PROPERTY,this.v_hst_str);
v_qprops_hash.Add(IBM.WMQ.MQC.PORT_PROPERTY, this.v_prt_int);
v_qprops_hash.Add(IBM.WMQ.MQC.CHANNEL_PROPERTY, this.v_chnl_str);
v_qprops_hash.Add(IBM.WMQ.MQC.USER_ID_PROPERTY, this.v_usr_str);

IBM.WMQ.MQQueueManager v_qmng = new MQQueueManager(this.v_qmng_str, v_qprops_hash);

this.txt_err.Text = "_-_";
v_qmng.Disconnect();
}catch (IBM.WMQ.MQException exc){
this.txt_err.Text = "[" + exc.ReasonCode + "][" + exc.Reason + "][" + exc.Source + "][" + exc.StackTrace + "]";
} catch(System.Exception exc) {
this.txt_err.Text = "[" + exc.Message + "][" + exc.StackTrace + "]";
}
}
}
}
------------------------------------------------------------------------------------------------------------------------------------

----figure_2-----------------------------------------------------------------------------------------------------------------
[Object reference not set to an instance of an object.][ at IBM.WMQ.Nmqi.NmqiTools.GetQueueManagerInfo(NmqiEnvironment env, NmqiMQ mq, Hconn hconn)
at IBM.WMQ.Nmqi.UnmanagedHconn.UpdateHconn(NmqiMQ mqInstance, Phconn phconn)
at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQCNO& pConnectOpts, Hconn parentHconn, Phconn phconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.Nmqi.UnmanagedNmqiMQ.MQCONNX(String pQMgrName, MQConnectOptions pConnectOpts, Phconn phconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
at WINMQ.Form1.btn_test_Click(Object sender, EventArgs e) in C:\DEV_LAB\MQ\WINMQ\WINMQ\Form1.cs:line 54]
------------------------------------------------------------------------------------------------------------------------------

The setting parameters:
------------------------------------------------------
MQ Server version info:
Name: WebSphere MQ
Version: 7.0.1.0
CMVC level: p000-L090814
BuildType: IKAP - (Production)
------------------------------------------------------
Server OS: HP-UX 11.31 v3
------------------------------------------------------
Client OS: Windows XP SP2
------------------------------------------------------
MQ Client version info:
Name: WebSphere MQ
Version: 7.0.1.0
CMVC level: p000-L090813
BuildType: IKAP - (Production)
------------------------------------------------------

Had anybody came across and how could be overcame?

Thanks in advance.

Best Regards,
Back to top
View user's profile Send private message
anar
PostPosted: Tue Jun 29, 2010 4:52 am    Post subject: little correction Reply with quote

Apprentice

Joined: 28 Jun 2010
Posts: 31

the client app is actually just windows forms, not ASP.NET yet.
Back to top
View user's profile Send private message
anar
PostPosted: Tue Jun 29, 2010 5:14 am    Post subject: additional info Reply with quote

Apprentice

Joined: 28 Jun 2010
Posts: 31

Below is what I get from command prompt:

C:\Documents and Settings\anar.v>amqscnxc -x 172.0.0.235(1415) -c CHL.CLI.MS.NET TST12.QUEUE.MANAGER
Sample AMQSCNXC start
Connecting to queue manager TST12.QUEUE.MANAGER
using the server connection channel CHL.CLI.MS.NET
on connection name 172.0.0.235(1415).
Connection established to queue manager TST12.QUEUE.MANAGER

Sample AMQSCNXC end

C:\Documents and Settings\anar.v>
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 29, 2010 5:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

'string' is not the same datatype as 'String'.

Review the sample code.
Back to top
View user's profile Send private message
anar
PostPosted: Tue Jun 29, 2010 6:08 am    Post subject: string Reply with quote

Apprentice

Joined: 28 Jun 2010
Posts: 31

Thanks for notifying, but "string" is just kind of an "alias" to System.String.

Not surprisingly that the result was the same.
Back to top
View user's profile Send private message
anar
PostPosted: Thu Jul 01, 2010 11:26 pm    Post subject: resolved Reply with quote

Apprentice

Joined: 28 Jun 2010
Posts: 31

The issue was resolved by the pointed fix:
http://www-01.ibm.com/support/docview.wss?uid=swg1IC67868
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » ASP.NET C# - MQ Client connection
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.