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 » toBitstream of Environment tree

Post new topic  Reply to topic
 toBitstream of Environment tree « View previous topic :: View next topic » 
Author Message
mqbrks
PostPosted: Thu Feb 16, 2012 12:19 pm    Post subject: toBitstream of Environment tree Reply with quote

Voyager

Joined: 17 Jan 2012
Posts: 75

Hi All,

I didn't get a solution for this in this forum, so posting this question.

I knew that we can convert any incoming message tree to bitstream as it has all encoding,ccsid available.

I am using a JCN, and can we convert a environment tree to bitstream?? I have seen that in ESQL, we can do this by giving the options. But not sure whether we can do this in JCN for environment tree.

Your inputs please.

Thank You!
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Feb 16, 2012 12:28 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

This article show you how to navigate the tree structure within a JCN.

http://www.ibm.com/developerworks/websphere/library/techarticles/0605_crocker/0605_crocker.html

The question you pose has a simple answer. If you read the article, and try some of the exercises and samples in the toolkit, still not understand, post back more specific question about what you are not understanding.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
adubya
PostPosted: Thu Feb 16, 2012 12:47 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

The documentation states that you can only use the MbElement .toBitstream() method on the message body (lastchild of root) so no good for the environment tree.
Back to top
View user's profile Send private message Send e-mail
mqbrks
PostPosted: Thu Feb 16, 2012 12:47 pm    Post subject: Reply with quote

Voyager

Joined: 17 Jan 2012
Posts: 75

lancelotlinc wrote:
This article show you how to navigate the tree structure within a JCN.

http://www.ibm.com/developerworks/websphere/library/techarticles/0605_crocker/0605_crocker.html

The question you pose has a simple answer. If you read the article, and try some of the exercises and samples in the toolkit, still not understand, post back more specific question about what you are not understanding.


Hi Lancelotlinc,

Thanks for your reply!

I am not asking about navigating in JCN. I knew about xpath and java coding,the message structure. My question is specific - can we convert a environment tree to bitstream in JCN ? If yes, how?

For example -

MbElement globalEnv = contact admin.getGlobalEnvironment().getRootElement();

MbElement context = globalEnv.getFirstElementByPath("Request");

context.toBitStream("","","",1208,0,0); throws parsing errors(XML writing error).

I hope my question is clear now.


Thank You!
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Feb 16, 2012 12:57 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You seem to be missing "detach" function. mqjeff or kimbert might add more value here.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqbrks
PostPosted: Thu Feb 16, 2012 1:03 pm    Post subject: Reply with quote

Voyager

Joined: 17 Jan 2012
Posts: 75

I don't why inaassembly.getGlobalEnvironment() was printed like contact admin.getGlobalEnvironment()
Back to top
View user's profile Send private message
adubya
PostPosted: Thu Feb 16, 2012 1:04 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

lancelotlinc wrote:
You seem to be missing "detach" function. mqjeff or kimbert might add more value here.


Not too sure how that will help ?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Feb 16, 2012 1:13 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can only do ASBITSTREAM in ESQL on an Environment tree element if that element has a Parser associated with it.

Likewise, you would only be able to toBitstream in Java on an element that has a Parser associated with it.
Back to top
View user's profile Send private message
mqbrks
PostPosted: Thu Feb 16, 2012 1:50 pm    Post subject: Reply with quote

Voyager

Joined: 17 Jan 2012
Posts: 75

mqjeff wrote:
You can only do ASBITSTREAM in ESQL on an Environment tree element if that element has a Parser associated with it.

Likewise, you would only be able to toBitstream in Java on an element that has a Parser associated with it.


Thank you jeff, I just wanted a confirmation about this to be sure.

And just for info, "detach" is no way related, as I am not trying to eliminate any elements/tree.

Thank you all!
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 16, 2012 1:56 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You can write any tree, or any fragment of a tree to a bitstream using any of
- an output node
- ASBITSTREAM
- Java toBitstream
- PHP
- .Net
...IF, and ONLY IF the element at the root of the tree ( or fragment of tree ) has a parser associated with it.

Internally, all of the options listed above call the same code, using the same internal interfaces within message broker. So
- all of them will *inevitably* produce the same results
- MbElement.toBitstream() behaves as if it was a wrapper around ESQL ASBITSTREAM ( although it is not really ). Same applies to the equivalent functions in PHP and .Net

As lancelotincpointed out ( or at least implied ) you can also write a message tree by walking the tree using Java ( or ESQL, or PHP, or .Net ) and using custom code to construct a BLOB. But that is rarely the correct approach.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Thu Feb 16, 2012 10:08 pm    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi mqbrks,

I wonder did you find this thread while your were searching the forum?
http://www.mqseries.net/phpBB2/viewtopic.php?t=59391

I think there are some useful info for you how to serialize logical data tree to for example simple xml representation.

--
Marko
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » toBitstream of Environment tree
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.