简体   繁体   English

如何从Axis2 SOAP响应中删除头属性

[英]How to remove header attribute from Axis2 SOAP response

I am trying to remove the header attributes from a SOAP response. 我试图从SOAP响应中删除标头属性。

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. 我搜索并mustUnderstandmustUnderstand选项设置为false将删除header属性元素,但不删除header标记。

How do I remove the header tag from an Axis2 SOAP response? 如何从Axis2 SOAP响应中删除标头标记? Is it possible? 可能吗?

You can write SoapHandler that intercepts all your soap requests. 您可以编写SoapHandler来拦截所有的soap请求。 Inside SoapHandler you have access to SoapMessageContext than obtain SoapMessage.getEnvelope().getHeader() and play with header in all ways (remove/add header elements). SoapHandler内部,您可以访问SoapMessageContext不是获取SoapMessage.getEnvelope().getHeader()并以各种方式使用标头(删除/添加标头元素)。 This approach good because you introduce new layer in your api and can preprocess inbound and outbound messages without impact on your main code. 这种方法很好,因为您在api中引入了新层,并且可以预处理入站和出站邮件,而不会影响主代码。 Maybe following link will help you http://java.dzone.com/articles/creating-soap-message-handlers 也许以下链接将帮助您http://java.dzone.com/articles/creating-soap-message-handlers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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