diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-06 12:35:01 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-06 12:35:01 +0000 |
commit | 31f71e8e078644469dd2ed93d5873fc1050062e4 (patch) | |
tree | 4b1cf757ba3437e4206a8ba6f06602ee87ec837f /sca-java-2.x/trunk/modules/binding-ws-runtime-axis2 | |
parent | d0e15154ff66a8422425259d0b3b3a776a004cd5 (diff) |
TUSCANY-3932 - First part of this JIRA is to remove some inconsistencies in the way that callbacks are handled now. See JIRA for more comments on this first change.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1228150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-ws-runtime-axis2')
2 files changed, 19 insertions, 12 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 488de5a769..994a67d632 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 @@ -53,6 +53,7 @@ import org.apache.axis2.context.MessageContext; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.assembly.Endpoint; +import org.apache.tuscany.sca.assembly.SCABinding; import org.apache.tuscany.sca.binding.ws.WebServiceBinding; import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; import org.apache.tuscany.sca.binding.ws.axis2.context.WSAxis2BindingContext; @@ -90,7 +91,7 @@ public class Axis2ReferenceBindingInvoker implements Invoker { public static final QName QNAME_WSA_MESSAGEID = new QName(AddressingConstants.Final.WSA_NAMESPACE, AddressingConstants.WSA_MESSAGE_ID, AddressingConstants.WSA_DEFAULT_PREFIX); - public static final QName QNAME_CALLACK_EP_URI = new QName(org.apache.tuscany.sca.assembly.xml.Constants.SCA11_TUSCANY_NS, "CALLBACK_EP_URI"); + //public static final QName QNAME_CALLACK_EP_URI = new QName(org.apache.tuscany.sca.assembly.xml.Constants.SCA11_TUSCANY_NS, "CALLBACK_EP_URI"); private RuntimeEndpointReference endpointReference; private ServiceClient serviceClient; @@ -244,12 +245,19 @@ public class Axis2ReferenceBindingInvoker implements Invoker { // Add WS-Addressing header for the invocation of a bidirectional service if (callbackEndpoint != null) { // 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()); + // In Tuscany the ws binding is used as a remote delegate for the sca binding + // so we have to take care to pass the sca uri in the delegate case. + EndpointReference fromEPR = null; + if (callbackEndpoint.getBinding().getType().equals(SCABinding.TYPE)){ + fromEPR = new EndpointReference(callbackEndpoint.getURI()); + } else { + fromEPR = new EndpointReference(callbackEndpoint.getBinding().getURI()); + } // pass the callback structure URI as a reference parameter // this allows callback endpoints to be looked up via the registry when // the ws binding is being used as a delegate from the sca binding - fromEPR.addReferenceParameter(QNAME_CALLACK_EP_URI, callbackEndpoint.getURI()); + //fromEPR.addReferenceParameter(QNAME_CALLACK_EP_URI, callbackEndpoint.getURI()); addWSAFromHeader( sh, fromEPR ); addWSAActionHeader( sh ); 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 04257f9b55..da9549a414 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 @@ -254,15 +254,14 @@ public class TuscanyServiceProvider { OMElement refParms = from.getFirstChildWithName(QNAME_WSA_REFERENCE_PARAMETERS);
if( refParms != null ) {
msg.getHeaders().put(WS_REF_PARMS, refParms);
- Iterator iter = refParms.getChildrenWithLocalName("CALLBACK_EP_URI");
- if (iter != null && iter.hasNext()){
- OMElement callbackEPURI = (OMElement)iter.next();
- if (callbackEPURI != null){
- msg.getHeaders().put("CALLBACK_EP_URI", callbackEPURI.getText());
- }
- }
- }
-
+// Iterator iter = refParms.getChildrenWithLocalName("CALLBACK_EP_URI");
+// if (iter != null && iter.hasNext()){
+// OMElement callbackEPURI = (OMElement)iter.next();
+// if (callbackEPURI != null){
+// msg.getHeaders().put("CALLBACK_EP_URI", callbackEPURI.getText());
+// }
+// }
+ }
}
} // end if
|