From 99f951468fdd48de1004614e15595d1a300c4c33 Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Fri, 18 Jun 2010 21:00:50 +0000 Subject: Handle the receipt of messageID data from a wsa:MessageID header in an incoming Web service invocation of a bidirectional service, transmit this data to the callback invocation from the service and embed into a wsa:RelatesTo SOAP header in the callback Wen service message, as required by the OASIS Web Service Binding spec, described in TUSCANY-3592 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@956127 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/core/invocation/impl/JDKInvocationHandler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sca-java-2.x/trunk') diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java index d34d9c8638..412481886f 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java @@ -246,6 +246,9 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { Message msgContext = ThreadMessageContext.getMessageContext(); + // Deal with header information that needs to be copied from the message context to the new message... + transferMessageHeaders( msg, msgContext); + ThreadMessageContext.setMessageContext(msg); try { @@ -260,6 +263,17 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { ThreadMessageContext.setMessageContext(msgContext); } } + + /** + * Transfer relevant header information from the old message (incoming) to the new message (outgoing) + * @param newMsg + * @param oldMsg + */ + private void transferMessageHeaders( Message newMsg, Message oldMsg ) { + if( oldMsg == null ) return; + // For the present, simply copy all the headers + if( !oldMsg.getHeaders().isEmpty() ) newMsg.getHeaders().putAll( oldMsg.getHeaders() ); + } // end transferMessageHeaders /** * @return the callableReference -- cgit v1.2.3