diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-19 06:41:04 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-19 06:41:04 +0000 |
commit | e3c894b83f5b02aa019f5dd709e3f7d6e3fdfc9d (patch) | |
tree | be03445f177f7deb781befe024e060dc0ea23b08 /sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingInvoker.java | |
parent | c8ac9d68bc34566fc6f03dcfe25da1b500e2ab54 (diff) |
Handle the wsa:ReferenceParameters SOAP header if present on the invocation of a bidirectional service offered as a Web service - pass the parameters back in the SOAP headers of any callback operation invocation from the service to the client, as required by TUSCANY-3592
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@956193 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-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.java | 18 |
1 files changed, 15 insertions, 3 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 e02547e727..9db4d85440 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 @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.binding.ws.axis2.provider; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.util.Iterator; import javax.wsdl.Operation; import javax.wsdl.PortType; @@ -28,6 +29,7 @@ import javax.xml.namespace.QName; import org.apache.axiom.om.OMAttribute; import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMNode; import org.apache.axiom.soap.SOAPBody; import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axiom.soap.SOAPFactory; @@ -156,7 +158,7 @@ public class Axis2ReferenceBindingInvoker implements Invoker { requestMC.setTo( new EndpointReference(toAddress) ); if( isInvocationForCallback( msg ) ) { - addWSAToHeader( sh, toAddress ); + addWSAToHeader( sh, toAddress, msg ); addWSAActionHeader( sh ); addWSARelatesTo( sh, msg ); } // end if @@ -204,13 +206,23 @@ public class Axis2ReferenceBindingInvoker implements Invoker { } // end method addWSAFromHeader - private void addWSAToHeader( SOAPHeader sh, String address ) { + private static String WS_REF_PARMS = "WS_REFERENCE_PARAMETERS"; + private void addWSAToHeader( SOAPHeader sh, String address, Message msg ) { // Create wsa:To header which is required by ws-addressing spec - OMElement wsaToOM = sh.getOMFactory().createOMElement(QNAME_WSA_TO); wsaToOM.setText( address ); sh.addChild(wsaToOM); + // Deal with Reference Parameters, if present - copy to the header without the wsa:ReferenceParameters wrapper + OMElement refParms = (OMElement) msg.getHeaders().get(WS_REF_PARMS); + if( refParms != null ) { + Iterator<?> children = refParms.getChildren(); + while( children.hasNext() ) { + OMNode node = (OMNode) children.next(); + sh.addChild(node); + } + } // end if + } // end method addWSAActionHeader |