Author |
Message
|
klabran |
Posted: Tue Oct 04, 2005 3:49 pm Post subject: Putting XML msg via RFHUTIL acts differently than vb.net |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I have a flow that I am testing and if I use vb.net code to put the message to the queue the flow works. However, if I use RFHUTIL to put the same message I get an XML parsing error "end element expected" in the flow.
I have set the RFHUTIL to have the same encoding and Message format (MQSTR). If I go to the data tab and and select the Parsed radio button for RFHUTIL it can't completely parse the XML. It fails with a "end name does not match".
If I set it to the XML data format radio button it seems to read it without issue. What am I missing?
Thanks,
Kevin |
|
Back to top |
|
 |
JT |
Posted: Tue Oct 04, 2005 7:02 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Kevin,
As always, the more information you supply us, the better. Post the XML message. |
|
Back to top |
|
 |
billybong |
Posted: Wed Oct 05, 2005 12:29 am Post subject: |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Are you sure youre using a well structured xml document? Seems to me like you've misspelled an element ending or might be using more root elements than one. |
|
Back to top |
|
 |
klabran |
Posted: Wed Oct 05, 2005 8:41 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I have used this file over and over in many tests and the file in question is a production file that worked without issue.... The flow works if I send it via vb.net code but not via the RFHUTIL program....
If there was some malformed XML then both should fail or at least the flow once I parse it in my compute node.... right?
Kevin
Last edited by klabran on Wed Oct 05, 2005 9:07 am; edited 1 time in total |
|
Back to top |
|
 |
wschutz |
Posted: Wed Oct 05, 2005 8:45 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
How BIG is the XML message?
and can you paste it here? _________________ -wayne |
|
Back to top |
|
 |
klabran |
Posted: Wed Oct 05, 2005 8:49 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I can't really paste it. It is fairly large for pasting (160KB) and holds real data that is too sensitive to paste.  |
|
Back to top |
|
 |
wschutz |
Posted: Wed Oct 05, 2005 8:53 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Well...maybe its a bug in rfhutil... I assume you have this XML message in a file that you load into rfhutil? If so, is the message in a single record or multiple records? _________________ -wayne |
|
Back to top |
|
 |
klabran |
Posted: Wed Oct 05, 2005 9:04 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
It is a file I load into RFHUTIL and it is one large message with many messages in it (<Parent><Child></Child><Child></Child></Parent>)
* please do not use *.... Not sure how this is occuring but I did open up the file in Altova XML Spy and some of the tags in the file are split up with a Carriage Return. I removed them and RFHUTIL worked.
Now.... Why the different results?
If I send the unmodified message with the carriage returns splitting a tag name up with some simple put vb.net code the flow works. It doesn't croak on those elements where the extra carraige return is.
If I use RFHUTIL though for the same message then the flow croaks on those fields?
I am sending the message with the following vb.net code...
Code: |
Public Function PutQueue(ByVal QM As String, ByVal QN As String, _
ByVal Msg As String, ByVal OpenOptions As Integer) As Integer
Dim mqQMgr As MQQueueManager '* MQQueueManager instance
Dim mqQueue As MQQueue '* MQQueue instance
Dim mqMsg As MQMessage '* MQMessage instance
Dim mqPutMsgOpts As MQPutMessageOptions '* MQPutMessageOptions instance
Dim msgLen As Integer '* Message length
'*
'* Try to create an MQQueueManager instance
'*
Try
'* queue name, queue manager name provided
mqQMgr = New MQQueueManager(QM)
Catch mqe As MQException
'* stop if failed
Console.WriteLine("Creation of MQQueueManager ended with " & mqe.Message)
Return (mqe.Reason)
End Try
'*
'* Try to open the queue
'*
Try
mqQueue = mqQMgr.AccessQueue(QN, OpenOptions) '* open queue for input but not if MQM stopping
Catch mqe As MQException
'* stop if failed
Console.WriteLine("MQQueueManager::AccessQueue ended with {0}", mqe.Message)
Return (mqe.Reason)
End Try
'*
'* Put to the message queue
'*
msgLen = Msg.Length
If (msgLen > 0) Then
Try
'* put the next message to the queue
mqMsg = New MQMessage
'03/21/2004 Begin
mqMsg.CharacterSet = 437 'ascii - default is 1200 which is unicode.
'03/21/2004 End
mqMsg.ReplyToQueueManagerName = "QM_CC_P1"
'mqMsg.ReplyToQueueName = "MYREPLY"
mqMsg.Format = MQC.MQFMT_STRING
mqMsg.WriteString(Msg)
mqQueue.Put(mqMsg) ', mqPutMsgOpts)
Catch mqe As MQException
'* report the error
Console.WriteLine("MQQueue::Put ended with {0}", mqe.Message)
Return (mqe.Reason)
End Try
End If
Return (0)
End Function
'call in code - strLine is a string variable
PutRetVal = PutQueue(strQM, strQ, strLine, IBM.WMQ.MQC.MQOO_OUTPUT + IBM.WMQ.MQC.MQOO_SET_ALL_CONTEXT + IBM.WMQ.MQC.MQOO_FAIL_IF_QUIESCING)
|
In RFHUTIL I set the Message Format to MQSTR and the encoding is 437. So why the differing results?
Is the vb.net code stripping CR's and RFHUTIL not??? |
|
Back to top |
|
 |
EddieA |
Posted: Wed Oct 05, 2005 10:14 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
some of the tags in the file are split up with a Carriage Return |
There is an option in RFHUtil to strip out CR/LFs when loading data from a file.
Also, using anonymous references in the Broker can be "interesting" if the XML contains CR/LFs.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
klabran |
Posted: Wed Oct 05, 2005 10:37 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Thanks Eddie... That did the trick.
What do you mean by anonymous? |
|
Back to top |
|
 |
EddieA |
Posted: Wed Oct 05, 2005 1:32 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
What do you mean by anonymous |
Check out the ESQL manual for "Anonymous References".
The fun part begins, because the CR/LFs are actual entries in the parsed tree.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
klabran |
Posted: Wed Oct 05, 2005 1:46 pm Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Ah... That's why I see a diamond between all of my tags in the debugger....
 |
|
Back to top |
|
 |
klabran |
Posted: Thu Oct 06, 2005 6:32 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I didn't find much in the ESQL reference that causes me worry about the CR/LF's being mapped in my flows...?
My flows have been running great even with these CR/LF's. Is there something I should be worried about?
Kevin |
|
Back to top |
|
 |
RichA |
Posted: Thu Oct 06, 2005 6:59 am Post subject: |
|
|
 Centurion
Joined: 14 Mar 2002 Posts: 102
|
|
Back to top |
|
 |
|