开发者

Passing XmlBean.XmlObject to MessageDrivenBean

开发者 https://www.devze.com 2023-04-11 12:57 出处:网络
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.

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.Nu开发者_开发百科llPointerException

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号