org.apache.cxf.annotations.Policy org.apache.cxf.annotations.Policies (since 2.3) - 7.3

Talend ESB Service Developer Guide

Version
7.3
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-04-17

Used to attach WS-Policy fragments to a service or operation. The Policy supports the attributes:

uri

REQUIRED the location of the file containing the Policy definition

includeInWSDL

Whether to include the policy in the generated WSDL when generating a wsdl. Default it true

placement

Specify where to place the policy

faultClass

if placement is a FAULT, this specifies which fault the policy would apply to

Note: When using a custom Spring configuration, you'll need to import META-INF/cxf/cxf-extension-policy.xml
@Policies({
   @Policy(uri = "annotationpols/TestInterfacePolicy.xml"),
   @Policy(uri = "annotationpols/TestImplPolicy.xml",
      placement = Policy.Placement.SERVICE_PORT),
   @Policy(uri = "annotationpols/TestPortTypePolicy.xml", 
      placement = Policy.Placement.PORT_TYPE)
})
@WebService
public static interface TestInterface {
   @Policies({
       @Policy(uri = "annotationpols/TestOperationPolicy.xml"),
       @Policy(uri = "annotationpols/TestOperationInputPolicy.xml", 
          placement = Policy.Placement.BINDING_OPERATION_INPUT),
       @Policy(uri = "annotationpols/TestOperationOutputPolicy.xml", 
          placement = Policy.Placement.BINDING_OPERATION_OUTPUT),
       @Policy(uri = "annotationpols/TestOperationPTPolicy.xml", 
          placement = Policy.Placement.PORT_TYPE_OPERATION),
       @Policy(uri = "annotationpols/TestOperationPTInputPolicy.xml", 
          placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT),
       @Policy(uri = "annotationpols/TestOperationPTOutputPolicy.xml", 
          placement = Policy.Placement.PORT_TYPE_OPERATION_OUTPUT)
   })
   int echoInt(int i);
}