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 » getDOMNode() method of MBElement returns NULL

Post new topic  Reply to topic
 getDOMNode() method of MBElement returns NULL « View previous topic :: View next topic » 
Author Message
arijitdas08
PostPosted: Wed Oct 16, 2013 2:21 pm    Post subject: getDOMNode() method of MBElement returns NULL Reply with quote

Newbie

Joined: 16 Oct 2013
Posts: 1

I have the following code snippet for a java Node:

Code:
MbOutputTerminal out = getOutputTerminal("out");
      MbOutputTerminal alt = getOutputTerminal("alternate");
               
      // Get message tree root
            MbMessage inMessage = contact admin.getMessage();
            MbElement inMsgTreeRoot = inMessage.getRootElement();
            // Get environment tree root
            MbMessage envr = contact admin.getGlobalEnvironment();
            MbElement envrRoot = envr.getRootElement();

            // create new empty message
            MbMessage outMessage = new MbMessage();
            MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,
                  outMessage);
            try {      
               // Get work item
               MbElement parserElm = inMsgTreeRoot.getLastChild();
               MbElement workItem = parserElm.getFirstChild();
               
               System.out.println( "Rule Input--"+workItem.getDOMNode());

NOTE in Assembly without space comes out as contact admin
------------------
SOAP UI Request is as follows:

Code:
<soapenv:Envelope >
   <soapenv:Header/>
   <soapenv:Body>
      <mes:XferAddRq>
         <RqUID>123123123</RqUID>
         <FromAcctRef>
            <AcctKeys>
               <AcctId>3;1;DDA</AcctId>

            </AcctKeys>

         </FromAcctRef>
         <ToAcctRef>
          <AcctKeys>
               <AcctId>3;11;dda</AcctId>               
            </AcctKeys>
         </ToAcctRef>
         <CurAmt>
               <Amt>3123</Amt>
               <CurCode>
                  <CurCodeValue>USD</CurCodeValue>
               </CurCode>
         </CurAmt>
      </mes:XferAddRq>
   </soapenv:Body>
</soapenv:Envelope>


----------------------

When we call getFirstChild() method on MBElement, we get the proper value. But the getDOMNode() is always returning NULL.

Please let me know if something is not correct..
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 16, 2013 6:53 pm    Post subject: Reply with quote

Grand High Poobah

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

According to the IIB Infocenter http://pic.dhe.ibm.com/infocenter/wmbhelp/v9r0m0/topic/com.ibm.etools.mft.doc/ac30330_.htm?resultof=%22%67%65%74%44%4f%4d%4e%6f%64%65%22%20%22%67%65%74%64%6f%6d%6e%6f%64%22%20, you may need to go one level deeper before you can call this method. You workitem is the XML Document Root... so there is no DomainRoot for that element. It is the Domain Root.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
dogorsy
PostPosted: Thu Oct 17, 2013 1:30 am    Post subject: Re: getDOMNode() method of MBElement returns NULL Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

arijitdas08 wrote:
I have the following code snippet for a java Node:

Code:
MbOutputTerminal out = getOutputTerminal("out");
      MbOutputTerminal alt = getOutputTerminal("alternate");
               
      // Get message tree root
            MbMessage inMessage = contact admin.getMessage();
            MbElement inMsgTreeRoot = inMessage.getRootElement();
            // Get environment tree root
            MbMessage envr = contact admin.getGlobalEnvironment();
            MbElement envrRoot = envr.getRootElement();

            // create new empty message
            MbMessage outMessage = new MbMessage();
            MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,
                  outMessage);
            try {      
               // Get work item
               MbElement parserElm = inMsgTreeRoot.getLastChild();
               MbElement workItem = parserElm.getFirstChild();
               
               System.out.println( "Rule Input--"+workItem.getDOMNode());

NOTE in Assembly without space comes out as contact admin
------------------
SOAP UI Request is as follows:

Code:
<soapenv:Envelope >
   <soapenv:Header/>
   <soapenv:Body>
      <mes:XferAddRq>
         <RqUID>123123123</RqUID>
         <FromAcctRef>
            <AcctKeys>
               <AcctId>3;1;DDA</AcctId>

            </AcctKeys>

         </FromAcctRef>
         <ToAcctRef>
          <AcctKeys>
               <AcctId>3;11;dda</AcctId>               
            </AcctKeys>
         </ToAcctRef>
         <CurAmt>
               <Amt>3123</Amt>
               <CurCode>
                  <CurCodeValue>USD</CurCodeValue>
               </CurCode>
         </CurAmt>
      </mes:XferAddRq>
   </soapenv:Body>
</soapenv:Envelope>


----------------------

When we call getFirstChild() method on MBElement, we get the proper value. But the getDOMNode() is always returning NULL.

Please let me know if something is not correct..

WMB and IIB provide you with a debug facility. If you use it, you probably will find what the problem is, and in the process you will learn a few things.
Debugging the problem yourself not only will give you the satisfaction and sense of achievement, but also it will be quicker than posting a question in the forum. You need to understand that even if people answering your question are well intentioned, sometimes their answer is not the best solution, it is just an opinion.
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 » getDOMNode() method of MBElement returns NULL
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.