* @throws JMSException
*/
public static void retrieveAndSetPayload(org.apache.cxf.message.Message inMessage, Message message)
throws UnsupportedEncodingException, JMSException {
String messageType = null;
Object converted = new JMSMessageConverter().fromMessage(message);
if (converted instanceof String) {
inMessage.setContent(Reader.class, new StringReader((String)converted));
messageType = JMSConstants.TEXT_MESSAGE_TYPE;
} else if (converted instanceof byte[]) {
inMessage.setContent(InputStream.class, new ByteArrayInputStream((byte[])converted));