summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
index 652f67f5e1..43e34c1173 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
@@ -76,7 +76,9 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
* If you have a Tuscany message you can call this
*/
public void invokeAsyncResponse(Message responseMessage) {
- responseMessage.getHeaders().put("ASYNC_RESPONSE_INVOKER", this);
+ responseMessage.getHeaders().put(Constants.ASYNC_RESPONSE_INVOKER, this);
+ responseMessage.getHeaders().put(Constants.RELATES_TO, relatesToMsgID);
+
if ((requestEndpoint.getBindingProvider() instanceof EndpointAsyncProvider) &&
(((EndpointAsyncProvider)requestEndpoint.getBindingProvider()).supportsNativeAsync())){
// process the response as a native async response
@@ -114,6 +116,12 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
Message msg = messageFactory.createMessage();
msg.setOperation(getOperation());
+
+ // on the the following will be null depending
+ // on whether this is native or non-native async
+ msg.setTo(requestEndpoint);
+ msg.setFrom(responseEndpointReference);
+
if( args instanceof Throwable ) {
msg.setFaultBody(args);
} else {