String contentType = messageFormatter.getContentType(
msgContext, format, msgContext.getSoapAction());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
messageFormatter.writeTo(msgContext, format, baos, true);
baos.flush();
return baos.toByteArray();
} catch (IOException e) {
throw new AMQPSynapseException("IO Error while creating message", e);
}