此内容没有您所选择的语言版本。

Chapter 9.  WS Policy Framework


The calculation of the effective policy for each message as well as verification that the alternatives for that policy are supported happens in interceptors.

9.1.  Using The Policies Feature

The policies feature supports the following attributes:
ignoreUnknownAssertions
Indicates an exception should be thrown when encountering assertions for which no AssertionBuilders are registered (default:true). When set to false, a warning will be logged instead.
namespace
The namespace of the WS-Policy Framework specification (default: http://www.w3.org/ns/ws-policy).
The element also supports the following child elements:
alternativeSelector
A bean or reference to a bean that implements the org.apache.cxf.ws.policy.selector.AlternativeSelector interface. The default selector chooses the minimal alternative; that is, the one with the least number of assertions.
In addition, the element can have any number of Policy or PolicyReference child elements. This has the same effect as if the Policy or PolicyReference elements were attached to the wsdl:port element of the WSDL contract of the client or server endpoint to which the feature is applied (or to all endpoints if the feature is applied to the bus).
For example, to apply this feature to the bus and prevent exceptions being thrown when encountering unknown assertions:
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:cxf="http://cxf.apache.org/core"
       xmlns:p="http://cxf.apache.org/policy"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <cxf:bus>
        <cxf:features>
            <p:policies ignoreUnknownAssertions="true"/>
        </cxf:features>
    </cxf:bus>
</beans>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat