From 84ef34efa534032fbf89a7c1b30258a73c69a71b Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 5 Feb 2009 18:27:01 +0000 Subject: TUSCANY-2799 - don't return responses inside arrays. Generally reorg the code so that the message processors only worry about getting data in and out of JMS message while the interceptors worry about whether the data should be wrapped as an array. In this way the forward path can do array wrapping in order to keep databinding happy while the response path can omit array wrapping git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741219 13f79535-47bb-0310-9956-ffa450edef68 --- .../runtime/WireFormatJMSObjectServiceInterceptor.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/runtime/WireFormatJMSObjectServiceInterceptor.java') diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/runtime/WireFormatJMSObjectServiceInterceptor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/runtime/WireFormatJMSObjectServiceInterceptor.java index b06886fae0..bb3c036287 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/runtime/WireFormatJMSObjectServiceInterceptor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/runtime/WireFormatJMSObjectServiceInterceptor.java @@ -78,8 +78,13 @@ public class WireFormatJMSObjectServiceInterceptor implements Interceptor { javax.jms.Message jmsMsg = context.getJmsMsg(); Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg); - msg.setBody(requestPayload); - + + if (requestPayload != null && requestPayload.getClass().isArray()) { + msg.setBody(requestPayload); + } else { + msg.setBody(new Object[] {requestPayload}); + } + return msg; } @@ -92,7 +97,7 @@ public class WireFormatJMSObjectServiceInterceptor implements Interceptor { if (msg.isFault()) { responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody()); } else { - Object[] response = {msg.getBody()}; + Object response = msg.getBody(); responseJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, response); } -- cgit v1.2.3