UnmarshalHelper unmarshalHelper = new UnmarshalHelper(appInstance);
String payload = paramExchange.getIn().getBody(String.class);
OCObject ocObject = unmarshalHelper.xml2object(payload, true);
_OCCommonObject co = new _OCCommonObject(ocObject);
co.write();
LOG.info("Object '" + co.toString() + "' written to db");
ExchangePattern exchangePattern = paramExchange.getPattern();
if (exchangePattern == ExchangePattern.InOnly) {
paramExchange.setOut(paramExchange.getIn());
} else if (exchangePattern == ExchangePattern.InOut) {
co.read(); // повторно считываем сохраненный объект из базы
//LOG.info("After read "+co.toString());
MarshalHelper marshalHelper = new MarshalHelper(appInstance);
String payload2 = marshalHelper.object2xml(co, "UTF-8");
Message messageOut = paramExchange.getOut();
messageOut.setBody(payload2);