diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext')
-rw-r--r-- | branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/runtime/WireFormatJMSTextReferenceInterceptor.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/runtime/WireFormatJMSTextReferenceInterceptor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/runtime/WireFormatJMSTextReferenceInterceptor.java index fc797bf32d..49e745ffaa 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/runtime/WireFormatJMSTextReferenceInterceptor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/runtime/WireFormatJMSTextReferenceInterceptor.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.binding.jms.wireformat.jmstext.runtime; +import java.lang.reflect.InvocationTargetException; import javax.jms.JMSException; import javax.jms.Session; @@ -99,10 +100,15 @@ public class WireFormatJMSTextReferenceInterceptor implements Interceptor { public Message invokeResponse(Message msg) { if (msg.getBody() != null){ Object response = responseMessageProcessor.extractPayloadFromJMSMessage((javax.jms.Message)msg.getBody()); - if (response != null ){ - msg.setBody(response); + + if (response instanceof InvocationTargetException) { + msg.setFaultBody(((InvocationTargetException) response).getCause()); } else { - msg.setBody(null); + if (response != null){ + msg.setBody(response); + } else { + msg.setBody(null); + } } } |