Search code examples
c#.netwebsphereibm-mq

Configuring mq websphere 7 with .net


I am trying to connect to a remote queue using c#. I tried many ways to connect to the remote queue but it always fails with common errors like: MQRC_CHANNEL_CONFIG_ERROR or MQRC_HOST_NOT_AVAILABLE.

What I am doing is this:

        string channel = "QM_TEST.SVRCONN"; 
        string hostname = "<serverIp>"; 
        string queueName = "QM_TEST"; 
        string port = 1414; 

        props.Add(MQC.HOST_NAME_PROPERTY, hostname); 
        props.Add(MQC.CHANNEL_PROPERTY, channel); 
        props.Add(MQC.PORT_PROPERTY, port ); 
        props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED); 

        MQQueueManager mqQueue = new MQQueueManager(queueName, props); 

I have tried changing this but all failed.

I think that my problem is the server configurations.. can you point me to a full guide to how to configure a server and connect to it with .net?

My problem is connecting to a REMOTE server using .net and not to a local server.

Thank you!


Solution

  • The problem was that the CCSID between the client and the server were different.

    http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaf.doc%2Fcs12480_.htm

    On the client side I had to put

    Environment.SetEnvironmentVariable("MQCCSID", "437");
    

    Thats why I got:

    MQRC_CHANNEL_CONFIG_ERROR