搜索

65.12. 自定义标头和附加过滤

download PDF

如果您需要提供标头或附加的自定义处理,请扩展现有的 BasicMessageFilter,并覆盖适当的方法或写入 MessageFilter 接口的品牌新实施。
要使用您的自定义过滤器,请在 spring 上下文中添加全局或本地消息过滤器。

  • A)提供所有 Spring-WS 端点的全局自定义过滤器
<bean id="messageFilter" class="your.domain.myMessageFiler" scope="singleton" />

或者

  • b)本地 messageFilter 直接在端点上,如下所示:
to("spring-ws:http://yourdomain.com?messageFilter=#myEndpointSpecificMessageFilter");

如需更多信息,请参阅 CAMEL-5724

如果要创建自己的 MessageFilter,请考虑在类 BasicMessageFilter 中的默认 MessageFilter 实现中覆盖以下方法:

protected void doProcessSoapHeader(Message inOrOut, SoapMessage soapMessage)
{your code /*no need to call super*/ }

protected void doProcessSoapAttachements(Message inOrOut, SoapMessage response)
{ your code /*no need to call super*/ }
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.