[
https://issues.apache.org/jira/browse/TUSCANY-3985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160082#comment-13160082
]
Simon Laws commented on TUSCANY-3985:
-------------------------------------
To do this you have to manipulate the headers at the Axis level. You can do
this in one of two ways:
1/ Write a Tuscany policy interceptor that does something like:
public Message invoke(Message msg) {
WSAxis2BindingContext bindingContext = msg.getBindingContext();
OperationClient operationClient =
bindingContext.getAxisOperationClient();
MessageContext requestMC = operationClient.getMessageContext("Out");
// from requestMC I think you can get the envelope and do what you like
See
http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/
and
http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/
as examples of creating a policy and associated interceptors for both
reference and service sides
2/ Write a Tuscany policy interceptor that installs a native Axis interceptor
You can do this by adding the appropriate code to add the Axis interceptor
inside the configureBinding(Object context) operation of a Tuscany policy
provider. I can't lay my hand on an example of this but I'm sure there is one
somewhere. I'll update this JIRA if I find link.
If you've not created a policy for Tuscany 2.x before it can seem a bit
daunting so post to the mail list if you have questions.
> Manipulate custom SOAP headers
> ------------------------------
>
> Key: TUSCANY-3985
> URL: https://issues.apache.org/jira/browse/TUSCANY-3985
> Project: Tuscany
> Issue Type: New Feature
> Components: Java SCA Axis Binding Extension
> Environment: Any
> Reporter: Ricky Wong
>
> Is there any way to manipulate custom SOAP headers when using Web Services
> bindings? We need the team to both set values in SOAP headers as well as
> retrieve values from SOAP headers.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira