0

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?

4

1 回答 1

2

您可以编写SoapHandler拦截您所有的肥皂请求。在内部SoapHandler,您可以通过各种方式访问​​而SoapMessageContext不是获取SoapMessage.getEnvelope().getHeader()和使用标题(删除/添加标题元素)。这种方法很好,因为您在 api 中引入了新层,并且可以预处理入站和出站消息,而不会影响您的主代码。也许下面的链接会帮助你http://java.dzone.com/articles/creating-soap-message-handlers

于 2012-04-21T09:48:15.047 回答