Reputation: 887
I am trying to remove the header attributes from a SOAP response.
I have searched and ran across the idea that setting the mustUnderstand
option too false will remove the header attribute element, but not the header tag.
How do I remove the header tag from an Axis2 SOAP response? Is it possible?
Upvotes: 0
Views: 2432
Reputation: 10789
You can write SoapHandler
that intercepts all your soap requests. Inside SoapHandler
you have access to SoapMessageContext
than obtain SoapMessage.getEnvelope().getHeader()
and play with header in all ways (remove/add header elements). This approach good because you introduce new layer in your api and can preprocess inbound and outbound messages without impact on your main code.
Maybe following link will help you http://java.dzone.com/articles/creating-soap-message-handlers
Upvotes: 2