Author: ffang Date: Wed Jul 22 10:19:57 2009 New Revision: 796660 URL: http://svn.apache.org/viewvc?rev=796660&view=rev Log: Merged revisions 796659 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes
................ r796659 | ffang | 2009-07-22 18:14:21 +0800 (三, 22 7 2009) | 16 lines Merged revisions 796655 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes ................ r796655 | ffang | 2009-07-22 17:59:34 +0800 (三, 22 7 2009) | 9 lines 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.0.x-fixes/ (props changed) cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java Propchange: cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java?rev=796660&r1=796659&r2=796660&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java (original) +++ cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java Wed Jul 22 10:19:57 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; @@ -121,19 +125,39 @@ xchng.setInterfaceName(interfaceName); xchng.setOperation(bop.getName()); + //copy context + Map<String, Object> invocationContext = + (Map<String, Object>) message.get(Message.INVOCATION_CONTEXT); + if (invocationContext != null) { + for (Map.Entry<String, Object> ent : ((Map<String, Object>) 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); @@ -146,6 +170,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);
