/**
* {@inheritDoc}
*/
@Override
public Message compose(HttpBindingData source, Exchange exchange) throws Exception {
final Message message = exchange.createMessage();
getContextMapper().mapFrom(source, exchange.getContext(message));
QName msgType = getMessageType(exchange);
message.setContent(source.getBody());
Object content;
if ((msgType != null) && (QNameUtil.isJavaMessageType(msgType))) {
// Hack - the getContent() call triggers a conversion from native content type and the result is set as the new body
message.setContent(message.getContent(QNameUtil.toJavaMessageType(msgType)));
}
return message;
}