summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-06-15 12:57:56 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-06-15 12:57:56 +0000
commit79ecf91c24212abe87f4a4611c8c4ea5ff83f1fe (patch)
tree6591d25d0355b69a853339ae06cd7da05fcc5e2e /sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java
parentaa7a492dafebebba501cc26c205e0fd1c47440cb (diff)
TUSCANY-3594 - flow the actual callback URL in the SOAP header as opposed to the SCA endpoint URI. Thanks to Mike for working on this in parallel with writing the Otests for this.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@954856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java4
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/TuscanyServiceProvider.java10
2 files changed, 12 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java
index 712eba0cea..4db3522e53 100644
--- a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java
+++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java
@@ -135,7 +135,9 @@ public class Axis2ReferenceBindingInvoker implements Invoker {
// add WS-Addressing header
//FIXME: is there any way to use the Axis2 addressing support for this?
if (callbackEndpoint != null) {
- EndpointReference fromEPR = new EndpointReference(callbackEndpoint.getURI());
+ //EndpointReference fromEPR = new EndpointReference(callbackEndpoint.getURI());
+ // Load the actual callback endpoint URI into an Axis EPR ready to form the content of the wsa:From header
+ EndpointReference fromEPR = new EndpointReference(callbackEndpoint.getBinding().getURI());
SOAPEnvelope sev = requestMC.getEnvelope();
SOAPHeader sh = sev.getHeader();
OMElement epr =
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/TuscanyServiceProvider.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/TuscanyServiceProvider.java
index af492f7f2d..3defac736c 100644
--- a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/TuscanyServiceProvider.java
+++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/TuscanyServiceProvider.java
@@ -32,6 +32,7 @@ import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
@@ -56,6 +57,7 @@ public class TuscanyServiceProvider {
private MessageFactory messageFactory;
private FactoryExtensionPoint modelFactories;
private RuntimeAssemblyFactory assemblyFactory;
+ private WebServiceBindingFactory webServiceBindingFactory;
private Operation operation;
public TuscanyServiceProvider(ExtensionPointRegistry extensionPoints,
@@ -67,7 +69,8 @@ public class TuscanyServiceProvider {
this.operation = operation;
this.modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.assemblyFactory = (RuntimeAssemblyFactory)modelFactories.getFactory(AssemblyFactory.class);
+ this.assemblyFactory = (RuntimeAssemblyFactory)modelFactories.getFactory(AssemblyFactory.class);
+ this.webServiceBindingFactory = (WebServiceBindingFactory)modelFactories.getFactory(WebServiceBindingFactory.class);
}
public OMElement invoke(OMElement requestOM, MessageContext inMC) throws InvocationTargetException {
@@ -104,6 +107,11 @@ public class TuscanyServiceProvider {
from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
msg.setFrom(from);
Endpoint callbackEndpoint = assemblyFactory.createEndpoint();
+ //
+ WebServiceBinding cbBinding = webServiceBindingFactory.createWebServiceBinding();
+ cbBinding.setURI(callbackAddress);
+ callbackEndpoint.setBinding(cbBinding);
+ //
callbackEndpoint.setURI(callbackAddress);
callbackEndpoint.setUnresolved(true);
from.setCallbackEndpoint(callbackEndpoint);