I own the following findings in order to work againts WMQ Secure-Channel:
My question is how to utilize these resources and interact with a Secure Channel using the XMS API? (Using C#)
This is what I've tried so far, but without success:
private IConnectionFactory CreateConnectionFactory()
{
XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();
connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, _wmqHostName);
connectionFactory.SetIntProperty(XMSC.WMQ_PORT, _wmqPort);
connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, _wmqChannel);
connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, _wmqQueueManager);
connectionFactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, 0);
connectionFactory.SetStringProperty(XMSC.WMQ_SECURITY_EXIT, "MySecurityExitName");
return (connectionFactory);
}
I get the following error when calling it:
CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2195 . During execution of the specified method an exception was thrown by another component. See the linked exception for more information.
UPDATE:
I found the following Technote which describes my problem and its possible (not tested) solution:
I figured-out that you can't use an unmanaged Security Exit assembly with IBM.XMS API (IBM.XMS.dll
), and this is what I currently have.
From the XMS docs:
This property is relevant only when an application connects to a queue manager in managed client mode. Also, only managed exits are supported.
Eventually, I came up with replacing the usage of the XMS API with the MQ Classes for .NET (Native .NET API of IBM for WMQ) which does support using an unmanaged Security Exit, by setting its MQC.SECURITY_EXIT_PROPERTY
property (should be served in the form of a Hashtable
entry). To be more specific, this is the assembly: amqmdnet.dll