// a string representing the XDIME to be sent. If the
// given message has some content set then this will be
// used in favour of a URL source.
if (message.getContent() != null) {
toBeSent = new MultiChannelMessageImpl();
try {
toBeSent.setMessage(message.getContent());
toBeSent.setCharacterEncoding(message.getCharacterEncoding());
toBeSent.setSubject(message.getSubject());
} catch (MessageException e) {
throw new MessageServiceException(e);
}
} else {
toBeSent = new MultiChannelMessageImpl(
message.getURL(),
message.getSubject(),
message.getCharacterEncoding());
}