I'm trying to fix a problem with an application that sends a message to the SWIFT network. The application is a .NET application and it uses IBM's amdqmdnet.dll
assembly to communicate with the WebSphere MQ server. On the WebSphere MQ server the SWIFT Alliance software is running.
The messages are sent from the application, but does not enter the SWIFT network. Some investigation has revealed the following error message:
MQSeries Queue 'MQSWIFT/SWIFT.SENDER', Nbr 123, Session 4567, Sequence 890, Conversion error (From)
MQ Msg Id : AMQ MQSWIFT <XX><XX><XX>X <X>-<XX>
Message Info : Error in FIN block 1: can not find tag F01 in message
{.1.:.F.0.1. (rest of message removed)
The start of the message sent is {1:F01
and to me this looks like the message is encoded in UNICODE (UTF-16) but the SWIFT software expects ASCII. The SWIFT software sees {.1.:.F.0.1.
.
My question is: How do I send the message to the WebSphere MQ queue using ASCII encoding?
The connection has the properties MQC.TRANSPORT_PROPERTY
, MQC.HOST_NAME_PROPERTY
and MQC.CHANNEL_PROPERTY
set.
The queue is opened using the options MQC.MQOO_OUTPUT
and MQC.MQOO_FAIL_IF_QUIESCING
.
The message is created using the format MQC.MQFMT_STRING
and default put message options:
var mqMessage = new MQMessage { Format = MQC.MQFMT_STRING };
mqMessage.WriteString(swiftMessage);
var mqMessageOptions = new MQPutMessageOptions();
queue.Put(mqMessage, mqMessageOptions);
I have noticed that the MQC
enumeration has the value CODESET_819
which probably refers to ASCII but I have no idea if I need to use it and how.