252 WebSphere and .NET Coexistence
tbResult.Text = "MQ returned error: " + mqe.Message;
}
}
9. If you test your application at this point, you will see that the returned value
shown in the window is wrong; it shows RFH. What happened is that
WebSphere put a JMS message in the reply queue and the .NET Classes for
MQ do not recognize the JMS message format. The solution is to write your
own message formatter using the API and parse the message. Replace and
insert the following code after the // create message line in step 4 on
page 251.
// create message
mqMsg = new MQMessage();// create new message object
mqMsg.Format=MQC.MQFMT_RF_HEADER_2; //
mqMsg.Encoding = 273; //
mqMsg.CharacterSet = 819; //
// great Get Message Options & set them
mqGetMsgOpts = ...