Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 69528 invoked from network); 22 Jul 2009 09:58:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jul 2009 09:58:58 -0000 Received: (qmail 18068 invoked by uid 500); 22 Jul 2009 10:00:04 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 17989 invoked by uid 500); 22 Jul 2009 10:00:03 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 17980 invoked by uid 99); 22 Jul 2009 10:00:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 10:00:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 09:59:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A9A32238889C; Wed, 22 Jul 2009 09:59:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r796655 - in /cxf/branches/2.2.x-fixes: ./ rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java Date: Wed, 22 Jul 2009 09:59:34 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090722095934.A9A32238889C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Wed Jul 22 09:59:34 2009 New Revision: 796655 URL: http://svn.apache.org/viewvc?rev=796655&view=rev Log: Merged revisions 796648 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r796648 | ffang | 2009-07-22 17:50:31 +0800 (δΈ‰, 22 7 2009) | 1 line [CXF-2350]JBIConduitOutputStream should copy properties between JBI NormalizedMessage and cxf message invocation context ........ Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java?rev=796655&r1=796654&r2=796655&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java Wed Jul 22 09:59:34 2009 @@ -21,8 +21,12 @@ import java.io.IOException; import java.io.InputStream; +import java.io.Serializable; import java.lang.reflect.Member; import java.lang.reflect.Method; +import java.util.Collection; +import java.util.Map; +import java.util.Set; import java.util.logging.Logger; import javax.jbi.messaging.DeliveryChannel; @@ -123,19 +127,39 @@ xchng.setInterfaceName(interfaceName); xchng.setOperation(bop.getName()); + //copy context + Map invocationContext = + (Map) message.get(Message.INVOCATION_CONTEXT); + if (invocationContext != null) { + for (Map.Entry ent : ((Map) invocationContext + .get("RequestContext")).entrySet()) { + // check if value is Serializable, and if value is Map + // or collection, + // just exclude it since the entry of it may not be + // Serializable as well + if (ent.getValue() instanceof Serializable + && !(ent.getValue() instanceof Map) + && !(ent.getValue() instanceof Collection)) { + inMsg.setProperty(ent.getKey(), ent.getValue()); + } + } + } xchng.setMessage(inMsg, "in"); LOG.info("sending message"); if (!isOneWay) { channel.sendSync(xchng); NormalizedMessage outMsg = ((InOut)xchng).getOutMessage(); Source content = null; + Set normalizedMessageProps = null; if (outMsg != null) { content = outMsg.getContent(); + normalizedMessageProps = outMsg.getPropertyNames(); } else { if (((InOut)xchng).getFault() == null) { throw xchng.getError(); } content = ((InOut)xchng).getFault().getContent(); + normalizedMessageProps = ((InOut)xchng).getFault().getPropertyNames(); } Message inMessage = new MessageImpl(); message.getExchange().setInMessage(inMessage); @@ -148,6 +172,14 @@ inMessage.put(MessageExchange.class, xchng); + if (normalizedMessageProps != null) { + + for (Object name : normalizedMessageProps) { + inMessage.put((String) name, outMsg + .getProperty((String) name)); + + } + } conduit.getMessageObserver().onMessage(inMessage); xchng.setStatus(ExchangeStatus.DONE);