diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-24 08:13:02 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-24 08:13:02 +0000 |
commit | 8d6c3f989bb2f359091468534730080425afa8c4 (patch) | |
tree | 986a29d3ef78d0b960ddb4dc98e15adc831ffe84 /java/sca/modules/binding-ws-axis2 | |
parent | 9f462538f3ac1e5522a87206a0668ecdecc9e3c4 (diff) |
Change message getHeaders() operation to return a list, remove the QoS context and change various tests to take account of this assuming that the security information is now passed in the header. This pass the security context is not consolidated into a single subject. The tests that used to pass just a principal still do. Also add a delivery mode JMS policy test. Add some ignores.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@698457 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-axis2')
3 files changed, 7 insertions, 14 deletions
diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java index c51a5bad29..d4250e3244 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java @@ -808,7 +808,7 @@ public class Axis2ServiceProvider { WSSecurityEngineResult securityResult = (WSSecurityEngineResult)wshr.getResults().elementAt(count2); if ( securityResult.get("principal") != null ) { - message.getQoSContext().put(Message.QOS_CTX_SECURITY_PRINCIPAL, securityResult.get("principal")); + message.getHeaders().add(securityResult.get("principal")); } } } diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java index 58f7c11f60..873e23a98a 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java @@ -114,15 +114,5 @@ public class Axis2BindingBasicAuthenticationConfigurator { BasicAuthenticationPrincipal principal = new BasicAuthenticationPrincipal(username, password); subject.getPrincipals().add(principal); - - // Set the http headers - // This is just an experiment, looking at the alternatives to extracting - // username and password in the binding. With HTTP headers in the message it - // could be deferred to the interceptor. Asymetric though when compared with the - // reference support. - // how to defined the scheme for message headers? - msg.getHeaders().put("httpheaders", httpHeaderProperties); } - - } diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java index 0c3577104b..647f934c02 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java @@ -27,6 +27,7 @@ import org.apache.axiom.om.OMFactory; import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axiom.soap.SOAPHeader; import org.apache.axis2.context.MessageContext; +import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyUtil; import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeader; import org.apache.tuscany.sca.invocation.Message; @@ -46,9 +47,11 @@ public class Axis2BindingHeaderConfigurator { OMFactory factory = envelope.getOMFactory(); SOAPHeader soapHeader = envelope.getHeader(); - Axis2SOAPHeader header = (Axis2SOAPHeader)msg.getHeaders().get(headerQName.toString()); + Axis2SOAPHeader header = Axis2HeaderPolicyUtil.getHeader(msg, headerQName) ; - soapHeader.addChild(header.getAsSOAPHeaderBlock(factory)); + if (header != null){ + soapHeader.addChild(header.getAsSOAPHeaderBlock(factory)); + } } } @@ -60,7 +63,7 @@ public class Axis2BindingHeaderConfigurator { header.setAsSOAPHeaderBlock(omHeader); - msg.getHeaders().put(headerQName.toString(), header); + msg.getHeaders().add(header); } } |