if (!jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
// If there is only one arg we must add a wrapper if the operation is wrapper style
wrapper = this.outputWrapperMap.get(msg.getOperation().getName());
}
} catch (JMSException e) {
throw new JMSBindingException(e);
}
Object response;
if (jmsMsg instanceof BytesMessage) {
response = responseMessageProcessor.extractPayloadFromJMSBytesMessage(jmsMsg, wrapper);
} else {
response = responseMessageProcessor.extractPayloadFromJMSTextMessage(jmsMsg, wrapper);
}
if (response != null) {
msg.setBody(response);
try {
if (jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
FaultException e = new FaultException("remote exception", response);
OMElement om = (OMElement) response;
e.setFaultName(new QName(om.getNamespace().getNamespaceURI(), om.getLocalName()));
msg.setFaultBody(e);
}
} catch (JMSException e) {
throw new JMSBindingException(e);
}
} else {
msg.setBody(null);
}
}