How to specify MQ channel table location for .net web application using web.config
- by Matt
I've been going around in circles for a while on this one now. I'm trying to connect to a distributed queue manager using a supplied channel table file. I can get this to work if I specify the environmental variable MQCHLLIB and MQCHLTAB on my server. However the IBM documentation states that the .net config file can override these variables.
Here is what I have placed in my web.config file:
...
<configSections>
<section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<CHANNELS>
<add key="ChannelDefinitionDirectory" value="C:\temp"></add>
<add key="ChannelDefinitionFile" value="DSM_MOM_TEST.tab"></add>
</CHANNELS>
...
And here is the code that is executing:
Hashtable properties = new Hashtable();
//Add managed connection type to parameters.
const String connectionType = MQC.TRANSPORT_MQSERIES_CLIENT;
properties.Add(MQC.TRANSPORT_PROPERTY, connectionType);
return new MQQueueManager(queueManagerName, properties);
queueManagerName is set to the generic queue manager "*Q101T".
However this isn't working and I get an error returned: 2058 MQRC_Q_MGR_NAME_ERROR
I've been unable to find any more documentation on how to get this to work other than the environmental variables and the standard mqclient.ini should be overriden by the channels stanza in the web.config.
Is there something that I've missed in the code? Any tips would be greatly appreciated.