I have a Process from within Weblogic 10.3 that takes in an XmlObject, writes some values from that XmlObject into a table, then will be passing that xml to a JMS queue.
public void clientRequest(org.apache.xmlbeans.XmlObject x0) {
this.newMail = x0;
}
Once I receive the xml I then parse through it to get the data values, went through the motions of creating a new Document and populated a new weblogic.jms.extensions.XMLMessage with that document to send to a queue.
XMLmsg = qcon2.createXMLMessage();
..
Create Document elements
..
..
..
XMLmsg.setDocument(doc);
qsender.send(XMLmsg);
My question is, how come I cannot just pass the xmlbeans.XmlObject directly to the JMSQueue? Or at least extract the Document from the incoming XML, then place it into the newly created weblogic.jms.extensions.XMLMessage so it can be passed into the queue.
I've tried something of this nature, but all I'm getting back is java.lang.NullPointerException
Document doc = (Document) newMail.getDomNode();
However, it probably has something to do with the following case never being true... any ideas? What's the best practice here? Thanks
node.getNodeType() == node.DOCUMENT_TYPE_NODE
Although maybe not best practice, I simply set the text of the XML message to the incoming XML.
XMLmsg.setText(newMail.toString());
qsender.send(XMLmsg);
Another solution would've been to do an XML translation and store these into variables. Although my process had no reason to.