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 IndexIBM MQ Java / JMSHow to remove header data from JMS Message from Visual Basic

Post new topicReply to topic
How to remove header data from JMS Message from Visual Basic View previous topic :: View next topic
Author Message
Waltari
PostPosted: Tue Aug 14, 2007 10:25 am Post subject: How to remove header data from JMS Message from Visual Basic Reply with quote

Novice

Joined: 16 May 2007
Posts: 14

Hi folks.

Im working in VB.Net with Websphere, I can connect to MQ, but Im receiving jms messages and I wanna just the XML part, but when I'm trying to read the message and I converted the message in file .xml, when I'm try to load the xml file, I got one error because I got the message with this header

RFH   MQSTR  <mcd><Msd>jms_text</Msd></mcd> <jms><Dst>queue:///QL.BF.DIGIPRO.01?persistence=-1</Dst><Rto>queue:///QL.DIGIPRO.BF.01?persistence=-1</Rto><Tms>1187041674766</Tms><Exp>1187041974766</Exp></jms>

how to remove this header from VB.Net? , because i wanna just the xml part no more

Can anybody help me?

Thanks
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Tue Aug 14, 2007 10:35 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Tell the sending application to set TARGCLIENT=MQ

Or read about the MQRFH2 header.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Waltari
PostPosted: Tue Aug 14, 2007 10:41 am Post subject: Reply with quote

Novice

Joined: 16 May 2007
Posts: 14

look, Im getting the message from the Queue, other person put the jms message in the Queue, when I got the message, in its property Format has "MQRFH2 ", and I dont know how to remove this header.

What I have to do?
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Tue Aug 14, 2007 10:42 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you get them to change the TARGCLIENT property, then you won't have to remove the header.

If you read the documentation about the header, it will tell you where to look to find out how big it is, so you know how much of the front part of the message to ignore.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Waltari
PostPosted: Tue Aug 14, 2007 10:49 am Post subject: Reply with quote

Novice

Joined: 16 May 2007
Posts: 14

look I sent you one snippet from my project, where Im get the message, ok

MQgetmensajeopcion = New MQGetMessageOptions
MQgetmensajeopcion.Options = MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING
MQgetmensajeopcion.WaitInterval = 15000 ' 15 second limit for waiting
MQmensaje = New MQMessage
MQmensaje.Persistence = MQC.MQPER_PERSISTENT
MQmensaje.Format = MQC.MQFMT_STRING

MQcola.Get(MQmensaje, MQgetmensajeopcion)
Dim Filexml As StreamWriter = New StreamWriter("C:\Fasa1\ejemplo1.xml")

Filexml.Write(MQmensaje.ReadString(MQmensaje.MessageLength))
Filexml.Close()
'myDoc.LoadXml(MQmensaje.ReadString(MQmensaje.MessageLength))
myDoc.LoadXml("ejemplo1.xml") <------------ Here is where I'm trying to read the xml file, and I got errors
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Tue Aug 14, 2007 10:53 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The RFH2 header is part of the stream of bytes that comes in the Message Object.

You need to either a) Tell the sender to NOT include it - which is the TARGCLIENT property I mentioned, b) find out how much of that stream of bytes holds the RFH2 header - which is documented in the documentation on the RFH2 header, or c) figure out how to find out where your XML document starts, in that stream of bytes.

I don't care which of these three things you try.

I'm not going to be any more specific. None of these should take you more than ten minutes to figure out.

If you like, we can spend another three days discussing this.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Waltari
PostPosted: Tue Aug 14, 2007 10:56 am Post subject: Reply with quote

Novice

Joined: 16 May 2007
Posts: 14

Ok, thanks for your advice.
Back to top
View user's profile Send private message MSN Messenger
fjb_saper
PostPosted: Tue Aug 14, 2007 3:06 pm Post subject: Reply with quote

Grand High Poobah

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

If the sending application is being passed queue names have them set in URI format:
"queue://QMGR/QNAME?targetClient=1"

This will tell the JMS application not to send the JMS header...

Else you need to set it up as Jeff said in the JNDI.

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

MQSeries.net Forum IndexIBM MQ Java / JMSHow to remove header data from JMS Message from Visual Basic
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.