Author |
Message
|
Waltari |
Posted: Tue Aug 14, 2007 10:25 am Post subject: How to remove header data from JMS Message from Visual Basic |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 14, 2007 10:35 am Post subject: |
|
|
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 |
|
 |
Waltari |
Posted: Tue Aug 14, 2007 10:41 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 14, 2007 10:42 am Post subject: |
|
|
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 |
|
 |
Waltari |
Posted: Tue Aug 14, 2007 10:49 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 14, 2007 10:53 am Post subject: |
|
|
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 |
|
 |
Waltari |
Posted: Tue Aug 14, 2007 10:56 am Post subject: |
|
|
Novice
Joined: 16 May 2007 Posts: 14
|
Ok, thanks for your advice. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 14, 2007 3:06 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
|