Author |
Message
|
kbrown |
Posted: Tue Apr 09, 2013 5:51 am Post subject: Help reading XML w/ JavaCompute root.lastchild()=BLOB !=XML |
|
|
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 |
|
 |
McueMart |
Posted: Tue Apr 09, 2013 6:21 am Post subject: |
|
|
 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 |
|
 |
kbrown |
Posted: Tue Apr 09, 2013 6:27 am Post subject: |
|
|
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 |
|
 |
McueMart |
Posted: Tue Apr 09, 2013 6:30 am Post subject: |
|
|
 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 |
|
 |
kbrown |
Posted: Tue Apr 09, 2013 6:32 am Post subject: |
|
|
Newbie
Joined: 09 Apr 2013 Posts: 4
|
changing from the default parser seems to have worked. thanks for the help |
|
Back to top |
|
 |
kbrown |
Posted: Tue Apr 09, 2013 6:34 am Post subject: |
|
|
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 |
|
 |
lancelotlinc |
Posted: Tue Apr 09, 2013 6:41 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Tue Apr 09, 2013 9:01 pm Post subject: |
|
|
 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 |
|
 |
|