Author |
Message
|
alanwlwong |
Posted: Tue Apr 26, 2005 7:54 am Post subject: Urgent Help - Get MQRFH2 in VB.NET |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear all,
I need to write a VB.NET program to read the message from MQ. However the other side is using JMS to send the message and the FORMAT is MQRFH2.
How can i read the message? need to readbyte? as JMS get the header file for MQRFH2.
I have tried a lot and also fail to get.
Would anyone help me? really thanks a lot.
Last edited by alanwlwong on Tue Apr 26, 2005 8:40 am; edited 1 time in total |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Apr 26, 2005 8:39 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Have the other side not put on the MQRFH2 header in the first place. You can search this site for targclient and you'll get detailed information on how to do it. |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 8:42 am Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear bower5932,
I have searched but no found out.
Last edited by alanwlwong on Tue Apr 26, 2005 8:46 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 26, 2005 8:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's a button on this page, under "Serving MQSeries Professionals Worldwide".
It's called "Search".
Click on it, and put "targclient" in the search string field.
Welcome to the Internet. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 8:50 am Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear jefflowrey,
I have done it. but still no found out. Would you mind to give me some more concept. I know MQRFH2 gets the header of StrucID, version, strulength, Encoding, codedcharsetid, format, flags and CCSID.
But i don't know how to read from VB.NET.
is that i use
readstring (4) for first 4 bytes of StructID. then
readLong () for the version.
but seem gets corruption for doing this.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 26, 2005 8:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the sender changes their JMS Destination to use a target client of MQ...
Then there will be no MQRFH2 in the message.
So you won't have to read it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 8:57 am Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear jefflowrey,
But the other side is written by vendor, so they will put the header on it.
They will not change anything, so i could only handle in VB.NET
Cheers |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 9:13 am Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear all,
please have some advice on the method to get RFH2 header in VB.NET...thousand thanks for all of u. |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Apr 26, 2005 9:54 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
If the RFH2 header is there (and you can't get the other side to 'remove' it), then you are going to have to a parse it out (probably using readbytes) to get to the real message payload. There is a description of the RFH2 header in the Application Programming Guide that gives you its layout.
However, I'd still suggest that you pursue its never being put on the message. I'm assuming that the other side is probably using JMSAdmin (or something similar) to create its destination. It is a very simple matter to specify you don't want the RFH2 header included. The targclient search mentioned earlier should give you dozens of hits on this. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 26, 2005 5:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Instead of using VB.net use J# to wrap the java delivered classes by creating your own receiver. You will still be able to get at the message but now you can do it in JMS which will automatically strip the RFH header.
Nice thing is after writing your classes in Java to receive and extract the message you can invoke them from VB.NET.
Thanks for CLR
Enjoy  |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 6:39 pm Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Dear all,
I only can use VB.NET to get the message. i can not use other jms problem to get the message first. sorry the only way is that i get the message from VB.net. Really headache on this.
Any function in MQ API that can convert the format?
Cheers |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 26, 2005 6:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Learn .NET!
You can use any langage supported in .NET
So write your classes in J# and instanciate from VB.NET !!
 |
|
Back to top |
|
 |
alanwlwong |
Posted: Tue Apr 26, 2005 7:45 pm Post subject: |
|
|
Newbie
Joined: 26 Apr 2005 Posts: 7
|
Sorry fjb_saper,
I just get the task on Monday. And he needs me to complete this week. And i am .NET beginner and I try my best to write .NET this few days. I can't get enough to search MQ, .NET, testing the program. Set the MQ. |
|
Back to top |
|
 |
|