简体   繁体   中英

How to remove header attribute from Axis2 SOAP response

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM