I am looking to disable BSP Compliance (I dont want my message containing the elements ).
I have tried, to no avail:
OutflowConfiguration outflowConfig = new OutflowConfiguration();
outflowConfig.setBSPCompliant(false);
stub._getServiceClient().getOptions().setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, outflowConfig.getProperty());
Does anyone else know of a way to remove the element(s) from my outgoing SOAP Message in Axis2/Rampart?
I figured out I can setup a new outgoing phase (via axis2.xml), which passes in a MessageContext to my customer Handler, and then I can get the SOAPEnvelope/Header via the MessageContext, traverse the elements and nodes, find the element(s) I want to remove, and then call removeChild.
For outgoing (OutFlow) Axis2 messages, WSS(4J) signing seems to happen in the "Security" Phase.
So, I wanted to remove some XML Elements that got appended in the Security Phase. Specifically, the "ec:InclusiveNamespaces" elements. It seems to be from XML Exclusive Canonicalization, and I couldn't figure out any other way to disable this setting in WSS4J (apart from Re-Compiling Axis2/Rampart...)
So, we need to add our own, new, custom OutFlow Handler. After the Security Phase.
Next, make your Custom Handler Class :
As long as you're passing in your updated Axis2.xml into your ConfigurationContext, which then gets passed into your service stub, you should be good to go.
Here are some references I used for learning about phases: http://www.packtpub.com/article/handler-and-phase-in-apache-axis http://wso2.com/library/777/
I hope this helps at least one other person out =D