ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » MQGET RFH2 data that contains Unicode

Post new topic  Reply to topic Goto page 1, 2  Next
 MQGET RFH2 data that contains Unicode « View previous topic :: View next topic » 
Author Message
arthurlwf
PostPosted: Mon Feb 25, 2008 2:36 am    Post subject: MQGET RFH2 data that contains Unicode Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

By using Visual C++ v6 compiler, what is the best approach to retrieve data from MQGET where the response message contains RFH2 msg and unicode data?

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 25, 2008 2:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't think VCC v6 is still supported - either by Microsoft or (because it's not supported by MS) by MQ.

You should likely be using the current version of both WMQ and VCC. The *compiler* for the current version of VCC is available for free from MS.

Other than that, you just need to write code that does an MQ Get and then processes the MQRFH2.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 25, 2008 2:56 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Or as you are using an RFH2 get the XMS support pack and make sure all your software packages are at the right level.
There is a C++ version of XMS.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
arthurlwf
PostPosted: Mon Feb 25, 2008 3:22 am    Post subject: Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

Thanks for all the input. Currently I have a dll codes thats able to retrieve RFH2 msg via
MQGET(Hcon, /* connection handle */
Hobj, /* object handle */
&md, /* message descriptor */
&gmo, /* get message options */
buflen, /* buffer length */
buffer, /* message buffer */
&messlen, /* message length */
&CompCode, /* completion code */
&Reason); /* reason code */

And having issue to retrieve RFH2 msg with unicode data. The retrieved unicode data shows square box. Anybody got any idea how to retrieve RFH2 msg with unicode data?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 25, 2008 3:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

arthurlwf wrote:
And having issue to retrieve RFH2 msg with unicode data. The retrieved unicode data shows square box. Anybody got any idea how to retrieve RFH2 msg with unicode data?


That code doesn't retrieve an RFH2 msg, it retrieves a message. If it happens to contain an RFH2 then it must be being processed further down the application code. Hence if you're having problems with a message coded in Unicode then it's a straightforward coding / conversion problem.

I'd certainly endorse the suggestion of fjb_saper and urge you to consider XMS.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
arthurlwf
PostPosted: Mon Feb 25, 2008 4:07 am    Post subject: Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

Thanks for the input. With XMS, is it possible to convert the response data from MQBYTE to wchar_t data type? The wchar_t is used to support unicode data.

Is there any other alternative method besides XMS?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 25, 2008 4:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

arthurlwf wrote:
Thanks for the input. With XMS, is it possible to convert the response data from MQBYTE to wchar_t data type? The wchar_t is used to support unicode data.


You can code any kind of conversion you want. All messages are effectively a stream of bytes to MQ.

arthurlwf wrote:
Is there any other alternative method besides XMS?


Yes, you can code your own solution. It's not that bad really but it is reinventing the wheel a bit.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Feb 25, 2008 10:18 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

jefflowrey wrote:
The *compiler* for the current version of VCC is available for free from MS.

Actually, a complete VCC IDE is available for free, as long as you don't want the MFC pieces.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
arthurlwf
PostPosted: Mon Feb 25, 2008 6:03 pm    Post subject: Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

Vitor wrote:
arthurlwf wrote:
Is there any other alternative method besides XMS?


Yes, you can code your own solution. It's not that bad really but it is reinventing the wheel a bit.


Actually, I manage to retrieve RFH2 msg with unicode data by using Visual Basic 2005. Here is the retrieving method:
' Variable Declaration
Dim bytesData() As Byte
Dim i As Integer
Dim enc As New System.Text.UTF8Encoding
Dim strMessage as String = ""
bytesData = mqMsg.ReadBytes(mqMsg.MessageLength)

' Replace NULL character with dummy character
For i = 0 To mqMsg.MessageLength - 1
If Chr(bytesData(i)) = ControlChars.NullChar Then
bytesData(i) = 55
ElseIf Chr(bytesData(i)) = ControlChars.CrLf Then
bytesData(i) = 55
End If
Next
' Convert bytes to unicode string
strMessage = enc.GetString(bytesData)

Alas, I need to retrieve in C++ code.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 25, 2008 10:02 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

arthurlwf wrote:
Alas, I need to retrieve in C++ code.

So get the XMS c++ support pack already!


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
arthurlwf
PostPosted: Mon Feb 25, 2008 11:00 pm    Post subject: Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

fjb_saper wrote:
arthurlwf wrote:
Alas, I need to retrieve in C++ code.

So get the XMS c++ support pack already!



If VB.Net only requires a command to convert from Bytes to String.
Does C++ only method to convert from MQBYTE to wchar_t is via XMS library?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 26, 2008 3:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

arthurlwf wrote:
fjb_saper wrote:
arthurlwf wrote:
Alas, I need to retrieve in C++ code.

So get the XMS c++ support pack already!



If VB.Net only requires a command to convert from Bytes to String.
Does C++ only method to convert from MQBYTE to wchar_t is via XMS library?

You're not listening to our advice and you're obviously not reading it.
I bet you haven't even looked at the documentation of the XMS support pack to know why we are suggesting it to you.

Obviously this is not about a conversion from MQBYTE to wchar_t. And even if it were possible I doubt that you would be satisfied by the results. A byte array will contain values that are beyond the scope of the admissible values for a representation of a string...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Feb 26, 2008 4:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I really don't actually understand what the point about "an RFH2 with Unicode" characters is.

I also really don't understand what that bit about "replace NULL with dummy characters" is. It seems like a good way to mangle the header for no particular reason.

RFH2 headers can be in one of a few different allowable CCSIDs, one of wihch is a Unicode CCSID.

RFH2 headers also have a predefined structure that is not really treatable "as a string".

Code that wants to process an RFH2 header - or a message with an RFH2 header, needs to understand how to a) separate the header from the message body, b) process the RFH2 header, and c) process data in the appropriate CCSID as indicated in the RFH2/MQMD.

Programmers who don't want to understand any of those three steps should use something that knows how to do that for them. XMS is one of those things.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
arthurlwf
PostPosted: Tue Feb 26, 2008 8:18 pm    Post subject: Reply with quote

Newbie

Joined: 25 Feb 2008
Posts: 8

jefflowrey wrote:
I really don't actually understand what the point about "an RFH2 with Unicode" characters is.

I also really don't understand what that bit about "replace NULL with dummy characters" is. It seems like a good way to mangle the header for no particular reason.

RFH2 headers can be in one of a few different allowable CCSIDs, one of wihch is a Unicode CCSID.

RFH2 headers also have a predefined structure that is not really treatable "as a string".

Code that wants to process an RFH2 header - or a message with an RFH2 header, needs to understand how to a) separate the header from the message body, b) process the RFH2 header, and c) process data in the appropriate CCSID as indicated in the RFH2/MQMD.

Programmers who don't want to understand any of those three steps should use something that knows how to do that for them. XMS is one of those things.


Thanks for the clear explaination to use XMS. After installing the XMS library, i have a few query:
1) Do I need to install XMS library everytime the Dll is utilize to integrate to Websphere MQ?
2) Any idea where to find XMS sample code to put and retrieve RFH2 msg? It seems there are very limited info on XMS in google.

Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 26, 2008 8:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

XMS/JMS look for a good understanding on how JMS works with MQ (see using java manual). XMS works in a very similar way...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » MQGET RFH2 data that contains Unicode
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.