|
Page Edited :
CXF20DOC :
WSPConfiguration
WSPConfiguration has been edited by Dan Diephouse (Dec 17, 2007). Content:WS-Policy Framework ConfigurationCXF's WS-Policy Framework is described in more detail in the WS-Policy Framework User's Guide . Like manu pther features in CXF, the implementation is interceptor based, and thus the computation of the effective policy for a specific message as well as the verification that one of the alternatives of that effective policy is supported happen in interceptors. As there are quite a number of interceptors involved, these are not normally on the interceptor chains, i.e. the WS-Policy Framework is disabled. To enable it, use any of the following options: Using the Policies FeatureThe policies feature element is defined in namespace http://cxf.apache.org/policy-config
The element also support the the following child elements:
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 a 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>
Following configuration achieves the same as in the example above: <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"> <p:engine enabled="true" ignoreUnknownAssertions="true"> </beans> Specifying the Location of External AttachmentsTo specify the location of an external attachment that the policy framework should take into consideration when aggregating the policies applying to a specific message, you can use the <externalAttachment> element in the same namespace. It supports the following attributes:
Example: <p:externalAttachment location="classpath:org/apache/cxf/systest/ws/policy/addr-external.xml"/>
You can have any number of <externalAttachment> elements in your configuration file. |
Unsubscribe or edit your notifications preferences
