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 » WebSphere Message Broker (ACE) Support » BLOB To XML Conversion

Post new topic  Reply to topic
 BLOB To XML Conversion « View previous topic :: View next topic » 
Author Message
newguy
PostPosted: Thu Sep 07, 2006 3:24 am    Post subject: BLOB To XML Conversion Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Hi,

Can anyone give me an optimised solution for my problem,

My catch flow is like this....

Compute -> MQOutput

Input to Compute is "Invalid XML Message" as BLOB and in compute im casting BLOB to Character and forming XML Message.

But the coverted message is something like this
"<a>..<asd>d</asd>..<zxc>d</zxc>..</a>..asd"

Note: I can use RCD but problem if incoming message is not in proper XML format.
Back to top
View user's profile Send private message
cottonmouth
PostPosted: Thu Sep 07, 2006 3:44 am    Post subject: Reply with quote

Newbie

Joined: 07 Sep 2006
Posts: 5

How large are the messages that you predict will be parsed by the message?
_________________
Ours is not to reason why,
ours is just to do or die.
Back to top
View user's profile Send private message
newguy
PostPosted: Thu Sep 07, 2006 3:54 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Hi,

message size can be around 15 - 20 kb...

thanks in advance...
Back to top
View user's profile Send private message
cottonmouth
PostPosted: Thu Sep 07, 2006 4:13 am    Post subject: Reply with quote

Newbie

Joined: 07 Sep 2006
Posts: 5

I often devide flows involving invalid XML messages into three steps

1) Copy the payload of the XML to the Environment.var.payload in the first compute node and only passes on the headers to the next compute node with CopyMessageHeaders();

2) Use one or more compute nodes to modify/build data where I build up the new XML structure in Environment.var.OutgoingXml using Environment.var.payload as input. While passing on the headers using CopyEntireMessage();

3) Reattach the new payload (Environment.var.OutgoingXml) to the headers, thus creating a complete XML message for the output.


In your case I guess you need to replace the &lt and &gt in the BLOB or after casting.
_________________
Ours is not to reason why,
ours is just to do or die.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 07, 2006 4:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Maybe you're just reading the data wrong.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
newguy
PostPosted: Thu Sep 07, 2006 8:21 pm    Post subject: Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Hi,

This is my requirement (Error Handling)...

Input can be Valid or Invalid XML message

I ll be expecting MRM XML message. In case of parser exception control goes to Failure Terminal, where Im suppose to build error message which includes complete incoming message also.

But this is not possible since I need complete incoming message but I get message only till where it is parsed..

So I make it as BLOB and then use RCD to reset to MRM domain and do content and value validation (comput node) so that exception is thrown and can handle it in Catch Terminal.

Problem Im facing here is, if input message is not proper xml. I want that message to be embedded into my error message (xml format) as it is. I dont want to convert invalid xml to valid xml, want as it is.

Eg.,

Input: (Invalid XML Message)

<a>
<asd>d</asd>
<zxc>d</zxc>
</a>
asd

Output I have got after CASTing BLOB as Character


<SiebelMessage MessageType="Integration Object" IntObjectName="TP WMQ Error IO" IntObjectFormat="Siebel Hierarchical" ProcessName="DUMMY" ProcessVersion="1.0" ProcessType="CONNECTOR">
<ListOfTPWmqErrorIo>
<WmqError>
<DataReferenceLanguage>ENU</DataReferenceLanguage>
<InboundMessage>
<ListOfInterfaceAccountIo>
&lt;a&gt;..&lt;asd&gt;d&lt;/asd&gt;..&lt;zxc&gt;d&lt;/zxc&gt;..&lt;/a&gt;..asd
</ListOfInterfaceAccountIo>
<ErrorMessage>
<ErrorType>RecoverableException</ErrorType>
<ErrorText>Caught exception and rethrowing:ImbRecoverableException caught from worker-&gt;parse.:FI Handler Error: The Message ID that was received from the worker was not the same as the ID Previously specified.:SiebelMessage:</ErrorText>
<ErrorNumber>5337</ErrorNumber>
</ErrorMessage>
</InboundMessage>
<ErrorCode>E001</ErrorCode>
<MessageReferenceLanguage>ENU</MessageReferenceLanguage>
<Name>ACCOUNT V2.1 - 2.1 - 1-1VRNT - ASA101</Name>
<ProcessedDate>2006-09-07 16:43:14.557</ProcessedDate>
<ReceivedDate>2006-09-07 16:43:14.557</ReceivedDate>
<TransferredDate>2006-09-07 16:43:14.557</TransferredDate>
<Type>Connector</Type>
</WmqError>
</ListOfTPWmqErrorIo>
</SiebelMessage>




Thanks in advance...
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Sep 08, 2006 1:40 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Output I have got after CASTing BLOB as Character...
That's not an accurate description of what's happening. You should have said
Quote:
Output I have got after CASTing BLOB as Character, THEN adding the resulting string into the message tree, THEN serializing the message tree as XML

When message broker writes XML, it automatically escapes anything which looks like markup, or which might cause a problem to an XML application ( see http://www.mqseries.net/phpBB2/viewtopic.php?t=31534 ).
That is why you are seeing the character entities &lt; and &gt; in place of your < and >.

If you want to embed XML within XML, the correct way to do that is to enclose it in CDATA tags. e.g.
Code:
<embeddedXML><![CDATA[<a><asd>d</asd><zxc>d</zxc></a>]]></embeddedXML>
You can instruct the XML/XMLNS/XMLNSC parsers to do this - just search for 'CDATA' in the docs. Currently, it's not easy to persuade the MRM domain to write CDATA sections.
Back to top
View user's profile Send private message
kirankinnu
PostPosted: Wed Nov 01, 2006 12:06 pm    Post subject: FI Handler error Reply with quote

Centurion

Joined: 12 Jun 2004
Posts: 128
Location: Chicago, IL

Can anyone give a better example of how this will happen

Thank You
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Nov 01, 2006 1:43 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't understand the question. What do you want to know?
Back to top
View user's profile Send private message
bhaski
PostPosted: Tue Apr 03, 2007 5:10 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

use
Quote:
XML.AsisElementContent
to attach the message as in XML format and Pls let me know? if you don't know how to use? pls catch me.

Bhaksi.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 03, 2007 5:19 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Why are you posting on a thread which has seen no activity for five months?

XML.AsisElementContent should only be used as a last resort. I don't believe this scenario requires it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BLOB To XML Conversion
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.