logger.fatal(ele1.getMessage(), ele1);
throw new JMSException(ele1.getMessage());
}
controlArea.addContent(eResult);
XMLOutputter xOut = new XMLOutputter();
return xOut.outputString(errorDoc);
}
else {
return null;
}
}
}
catch (XmlDocumentReaderException e2) {
logger.fatal(getConsumerName() +
" - Error creating document from message passed in");
logger.fatal(e2.getMessage(), e2);
throw new JMSException(e2.getMessage());
}
Element inControlArea = getControlArea(inDoc.getRootElement());
String msgAction = null;
if (inControlArea != null) {
msgAction = inControlArea.getAttribute("messageAction").getValue();
}
else {
String errMessage =
getConsumerName() + " - Could not retrieve ControlArea from message passed in.";
logger.fatal(errMessage);
throw new JMSException(errMessage);
}
if (errorDoc != null) {
Element controlArea = getControlArea(errorDoc.getRootElement());
Result aResult = new Result();
aResult.setStatus("failure");
aResult.setAction(msgAction);
org.openeai.moa.objects.resources.Error anError =
new org.openeai.moa.objects.resources.Error();
anError.setType(errType);
anError.setErrorNumber(errNumber);
anError.setErrorDescription(errDesc);
ProcessedMessageId processedMsgId = new ProcessedMessageId();
Element eRequestSender = inControlArea.getChild("Sender");
Sender reqSender = new Sender();
try {
reqSender.buildObjectFromInput(eRequestSender);
}
catch (EnterpriseLayoutException ele) {
logger.fatal(ele.getMessage(), ele);
throw new JMSException(ele.getMessage());
}
processedMsgId.setProducerId(reqSender.getMessageId().getProducerId());
processedMsgId.setSenderAppId(reqSender.getMessageId().getSenderAppId());
processedMsgId.setMessageSeq(reqSender.getMessageId().getMessageSeq());
aResult.setProcessedMessageId(processedMsgId);
aResult.addError(anError);
controlArea.removeChild("Result");
Element eResult = null;
try {
eResult = (Element)aResult.buildOutputFromObject();
}
catch (EnterpriseLayoutException ele1) {
logger.fatal(ele1.getMessage(), ele1);
throw new JMSException(ele1.getMessage());
}
controlArea.addContent(eResult);
XMLOutputter xOut = new XMLOutputter();
return xOut.outputString(errorDoc);
}
return null;
}