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 » Help reading XML w/ JavaCompute root.lastchild()=BLOB !=XML

Post new topic  Reply to topic
 Help reading XML w/ JavaCompute root.lastchild()=BLOB !=XML « View previous topic :: View next topic » 
Author Message
kbrown
PostPosted: Tue Apr 09, 2013 5:51 am    Post subject: Help reading XML w/ JavaCompute root.lastchild()=BLOB !=XML Reply with quote

Newbie

Joined: 09 Apr 2013
Posts: 4

I am very new to working with the web sphere tools, and I am trying to figureout how the java compute node works specifically. I am able to write XML just fine, but reading it in is not working. this is what i have reading the xml inout

Code:
public void evaluate(MbMessageAssembly contact admin) throws MbException {
      
      MbOutputTerminal out = getOutputTerminal("out");

      MbMessage inMessage = contact admin.getMessage();

      MbMessage outMessage = new MbMessage();
      MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);
      
      
      try {
         
         // ----------------------------------------------------------------
         // Add user code below
         
         MbElement inRoot  = inMessage.getRootElement();                  // reference to root of incoming message
          MbElement outRoot = outMessage.getRootElement();                // reference to root of outgoing message
          MbElement outBody = outRoot.createElementAsLastChild("XMLNSC");
         
          MbElement CHECK = inRoot.getLastChild().getFirstChild().getNextSibling();
         
          String checkname = CHECK.getName();
         
         
         
          MbElement thebody = outBody.createElementAsLastChild(MbXMLNSC.FOLDER, "SaleList", checkname);         
          // End of user code
         // ----------------------------------------------------------

         // The following should only be changed
         // if not propagating message to the 'out' terminal
         out.propagate(outAssembly);

      } catch (Throwable e) {
         // Example Exception handling   
         MbUserException mbue = new MbUserException(this, "evaluate()", "","", e.toString(), null);
         throw mbue;
      }
   }


and the input xml is
Code:

<SaleEnvelope>
   <Header>help</Header>
   <test>HELP!!</test>
</SaleEnvelope>


This gives me "BLOB" back as the name of the first child insode the xml, I think, but it should be giving me "Header", I thought.

I hope this is enough information to get me a little help. Thank you in advance for the assistance.
Back to top
View user's profile Send private message Send e-mail
McueMart
PostPosted: Tue Apr 09, 2013 6:21 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

What Input node are you using? What do you have the Message domain set to under Input Message Parsing?
Back to top
View user's profile Send private message
kbrown
PostPosted: Tue Apr 09, 2013 6:27 am    Post subject: Reply with quote

Newbie

Joined: 09 Apr 2013
Posts: 4

Im using a MQ input node, and the message parsing I left blank. I see now that this may be my problem. would I just put "XML" here since my input will be an XML file. Like I said I am very new to this.
Back to top
View user's profile Send private message Send e-mail
McueMart
PostPosted: Tue Apr 09, 2013 6:30 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

You want to use XMLNSC (it'll be in the drop down). More importantly you are going to want to either acquire some training - or spend a lot of self study time getting to grips with Broker. It's not a trivial tool and you'll run into 100's of issues like this with no guidance.
Back to top
View user's profile Send private message
kbrown
PostPosted: Tue Apr 09, 2013 6:32 am    Post subject: Reply with quote

Newbie

Joined: 09 Apr 2013
Posts: 4

changing from the default parser seems to have worked. thanks for the help
Back to top
View user's profile Send private message Send e-mail
kbrown
PostPosted: Tue Apr 09, 2013 6:34 am    Post subject: Reply with quote

Newbie

Joined: 09 Apr 2013
Posts: 4

yea. tell me about it. i dont think my company wants to drop the dime for the 3k IBM training so they have just stuck us with some peopel who know similar tools and told use to self study for a while.
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Tue Apr 09, 2013 6:41 am    Post subject: Reply with quote

Jedi Knight

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

kbrown wrote:
yea. tell me about it. i dont think my company wants to drop the dime for the 3k IBM training so they have just stuck us with some peopel who know similar tools and told use to self study for a while.


There are nine days of training, around $8.8 k US.
_________________
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
fjb_saper
PostPosted: Tue Apr 09, 2013 9:01 pm    Post subject: Reply with quote

Grand High Poobah

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

I didn't see the
Code:
} finally {
 outMessage.clearMessage()}
or similar (from memory).
This means you have baked into your JCN a native memory leak!

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

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Help reading XML w/ JavaCompute root.lastchild()=BLOB !=XML
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.