|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQCCSID configuration |
« View previous topic :: View next topic » |
Author |
Message
|
xiphoid |
Posted: Tue Feb 24, 2009 1:31 pm Post subject: MQCCSID configuration |
|
|
Newbie
Joined: 24 Feb 2009 Posts: 5
|
Compiled a C# messaging program on an english windows , and currently executing it on a polish windows pc.
first got this error:
The program ended because, either the source CCSID '819' or the target CCSID '852' is not valid, or is not currently supported.
solution:
environment variables : set MQCCSID =819
after this solution got the next error:
There is no definition of channel 'EXIM_CHAN' at the remote location.
Add an appropriate definition to the remote hosts list of defined channels and retry the operation.
On the ibm mqserver (installed on an AIX server) the channel with this name 'EXIM_CHAN' exist, and is proven by amqsputc (see below).
The commandline tool amqsputc works ok and seems to find the channel but the problem with this tool is that it cuts the message off after 100 characters which gives problems to our service programm later on.
Please some feedback about my overlooking things or not understanding things,
Thanks in advance |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 24, 2009 2:29 pm Post subject: Re: MQCCSID configuration |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xiphoid wrote: |
On the ibm mqserver (installed on an AIX server) the channel with this name 'EXIM_CHAN' exist, and is proven by amqsputc (see below). |
What kind of channel is EXIM_CHAN? It sounds like you're trying to use it both as a client connection and a link to another queue manager.
xiphoid wrote: |
The commandline tool amqsputc works ok and seems to find the channel but the problem with this tool is that it cuts the message off after 100 characters which gives problems to our service programm later on. |
It's not a tool - amqsputc is a piece of sample code. It's limited to 100 characters but that's just what it's supplied as.
xiphoid wrote: |
Please some feedback about my overlooking things or not understanding things, |
We'll need a bit more about your topology to be much assistance. Aside from the obvious "read the Intercommunication manual & check your setup". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
xiphoid |
Posted: Tue Feb 24, 2009 3:36 pm Post subject: |
|
|
Newbie
Joined: 24 Feb 2009 Posts: 5
|
this is my code :
using System;
using System.Collections.Generic;
using System.Text;
using IBM.WMQ;
namespace MQ2
{
//namespace MQExample
public class MQTest
{
MQQueueManager queueManager;
MQQueue queue;
MQMessage queueMessage;
MQPutMessageOptions queuePutMessageOptions;
MQGetMessageOptions queueGetMessageOptions;
static string QueueName;
static string QueueManagerName;
static string ChannelInfo;
string channelName;
string transportType;
string connectionName;
string message;
//Connecting to MQQueueManager with ConnectMQ
public string ConnectMQ(string strQueueManagerName, string strQueueName,
string strChannelInfo)
{
//
QueueManagerName = strQueueManagerName;
QueueName = strQueueName;
ChannelInfo = strChannelInfo;
//
char[] separator = {'/'};
string[] ChannelParams;
ChannelParams = ChannelInfo.Split( separator );
channelName = ChannelParams[0];
transportType = ChannelParams[1];
connectionName = ChannelParams[2];
String strReturn = "";
try
{
queueManager = new MQQueueManager( QueueManagerName,
channelName, connectionName );
strReturn = "Connected Successfully";
}
catch(MQException exp)
{
strReturn = "Exception: " + exp.Message ;
}
return strReturn;
}
//Disconnecting from MQQueueManager with Disconnect
public void DisConnect()
{
queueManager.Disconnect();
}
// Write Message to the IBM MQServer with the WriteMsg function
public string WriteMsg(string strInputMsg)
{
string strReturn = "";
try
{
queue = queueManager.AccessQueue( QueueName,MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING );
message = strInputMsg;
queueMessage = new MQMessage();
queueMessage.WriteString( message );
queueMessage.Format = MQC.MQFMT_STRING;
queuePutMessageOptions = new MQPutMessageOptions();
queue.Put( queueMessage, queuePutMessageOptions );
strReturn = "Message sent to the queue successfully";
}
catch(MQException MQexp)
{
strReturn = "Exception: " + MQexp.Message ;
}
catch(Exception exp)
{
strReturn = "Exception: " + exp.Message ;
}
return strReturn;
}
//Read message from the IBM MQServer with the ReadMsg function
public string ReadMsg()
{
String strReturn = "";
try
{
queue = queueManager.AccessQueue( QueueName,MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);
queueMessage = new MQMessage();
queueMessage.Format = MQC.MQFMT_STRING;
queueGetMessageOptions = new MQGetMessageOptions();
queue.Get( queueMessage, queueGetMessageOptions );
strReturn = queueMessage.ReadString(queueMessage.MessageLength);
}
catch (MQException MQexp)
{
strReturn = "Exception : " + MQexp.Message ;
}
catch(Exception exp)
{
strReturn = "Exception: " + exp.Message ;
}
return strReturn;
}
}
}
form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using IBM.WMQ;
using MQ2.Popup;
namespace MQ2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
MQTest _myMQ;
/// <summary>
/// The base queue object
/// </summary>
public MQTest myMQ
{
get
{
if (_myMQ == null)
{
_myMQ = new MQTest();
}
return _myMQ;
}
set { _myMQ = value; }
}
private void btnConnect_Click(object sender, EventArgs e)
{
string strQueueManagerName;
string strQueueName;
string strChannelInfo;
//TODO
//PUT Valication Code Here
strQueueManagerName = txtQueueManagerName.Text;
strQueueName = txtQueueName.Text;
strChannelInfo = txtChannelInfo.Text;
lblConnect.Text = myMQ.ConnectMQ(strQueueManagerName, strQueueName, strChannelInfo);
lblDisConnect.Text = "";
}
private void btnWriteMsg_Click(object sender, EventArgs e)
{
txtPUT.Text = myMQ.WriteMsg(txtPUT.Text.ToString());
}
private void btnReadMsg_Click(object sender, EventArgs e)
{
txtGET.Text = myMQ.ReadMsg();
}
private void btnDisconnect_Click(object sender, EventArgs e)
{
try
{
myMQ.DisConnect();
lblConnect.Text = "disconnected";
}
catch (Exception Ex)
{
lblConnect.Text = String.Format("Problem while disconnecting({0})",Ex.Message);
}
}
private void helpToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox1 ab = new AboutBox1();
ab.Show();
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1.ActiveForm.Close();
}
private void loadTestToolStripMenuItem_Click(object sender, EventArgs e)
{
this.txtPUT.Text = @"<PRETORIUS><XFIXED_FORMAT><LINE><![CDATA[SAMPLE 8.999990000000905010001]]></LINE></XFIXED_FORMAT></PRETORIUS>";
this.txtChannelInfo.Text = @"EXIM_CHAN/TCP/serverMQ/(8930)";
this.txtQueueManagerName.Text = "qman";
this.txtQueueName.Text = "Q1";
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
} |
|
Back to top |
|
 |
xiphoid |
Posted: Tue Feb 24, 2009 3:40 pm Post subject: |
|
|
Newbie
Joined: 24 Feb 2009 Posts: 5
|
I compiled this tool ,it works perfect if connected between windows xp uk and windows server uk Mqserver v 6.0.
these are the settings which i fill out in this form
qmanagername: qman
Queuename: EXIM_CHAN
Channelinfo: CHAN1/TCP/serverMQ/(8930) |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 25, 2009 12:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xiphoid wrote: |
I compiled this tool ,it works perfect if connected between windows xp uk and windows server uk Mqserver v 6.0.
|
Then you need to spend a bit more time with the .NET and Clients manual.
Also think about what your code is doing. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|