diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-29 20:47:44 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-29 20:47:44 +0000 |
commit | 1a2fe860fa6f790b95a0ea5978ee7f1a40c06c0c (patch) | |
tree | eae5d4a0024557122a76fb1159516638e576e5ea | |
parent | 4d09109a945cfaf83817e3a64ab9c5275a3dd540 (diff) |
TUSCANY-3822: call PolicyHandler.afterInvoke() with outbound MessageContext containing response message
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1086734 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 13 insertions, 3 deletions
diff --git a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java index a0cfab9154..ab96cc371f 100644 --- a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java +++ b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java @@ -65,6 +65,11 @@ public class Axis2ServiceInMessageReceiver extends AbstractInMessageReceiver { } */ + // TUSCANY-3822: moved afterInvoke() call from Axis2ServiceProvider + for ( PolicyHandler policyHandler : policyHandlerList ) { + policyHandler.afterInvoke(null, inMC); + } + } catch (InvocationTargetException e) { Throwable t = e.getCause(); if (t instanceof Exception) { diff --git a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java index d467e0b3c8..e5635da44f 100644 --- a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java +++ b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java @@ -80,6 +80,12 @@ public class Axis2ServiceInOutSyncMessageReceiver extends AbstractInOutSyncMessa soapEnvelope.getBody().addChild(responseOM); } outMC.setEnvelope(soapEnvelope); + + // TUSCANY-3822: moved afterInvoke() call from Axis2ServiceProvider + for ( PolicyHandler policyHandler : policyHandlerList ) { + policyHandler.afterInvoke(responseOM, outMC); + } + outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE); } catch (InvocationTargetException e) { diff --git a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java index 456001e615..29d0cdb818 100644 --- a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java +++ b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java @@ -765,9 +765,8 @@ public class Axis2ServiceProvider { RuntimeWire wire = ((RuntimeComponentService)contract).getRuntimeWire(getBinding()); Object response = wire.invoke(op, msg); - for ( PolicyHandler policyHandler : policyHandlerList ) { - policyHandler.afterInvoke(response, inMC); - } + // TUSCANY-3822: moved afterInvoke() call to Axis2ServiceInOutSyncMessageReceiver + // and Axis2ServiceInMessageReceiver return response; } |