I'm currently using IBM Integration Bus v9 and I'm trying to get the DOM Node (org.w3c.dom.Node) from an aggregated message to unmarshall it into a Java Object.
In the first version of my flow, I was calling just one Web Service synchronously and, from a Java Compute Node, I was getting the DOM Document directly from the MbMessage and was unmarshalling the following way (source):
MbMessage inMessage = inAssembly.getMessage();
JAXBElement<BefpDocData> inMsgJavaObj = jaxbContext.createUnmarshaller().unmarshal(inMessage.getDOMDocument(), BefpDocData.class);
BefpDocData data = inMsgJavaObj.getValue();
The second version of my flow now calls two Web Services asynchronously and aggregate them with an AggregateReply node. In this case, I'm trying this way:
MbMessage inMessage = inAssembly.getMessage();
MbElement comIbmAggregateReplyBody = inMessage.getRootElement().getFirstElementByPath("/ComIbmAggregateReplyBody");
MbElement docGenBefa = comIbmAggregateReplyBody.getFirstElementByPath("/ComIbmAggregateReplyBody/DocGenBefa");
MbElement docGenBefaXML = docGenBefa.getLastChild();
Node docGenBefaNode = docGenBefaXML.getDOMNode();
JAXBElement<BefpDocData> inMsgJavaObj = jaxbContext.createUnmarshaller().unmarshal(docGenBefaNode, BefpDocData.class);
BefpDocData data = inMsgJavaObj.getValue();
My problem ist that the getDomNode always returns null despite the fact that the docGenBefaXML points on the XMLNSC part of the message. I tried to call the getDomNode method on various elements of the tree structure and it always returns null.
The structure of an aggregated message is described here.
Does anyone have any idea how to solve this ?