Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-milestone2, 2.7.10
-
None
-
Unknown
Description
In CXF 2.7.10 when using Java First WS-Policy Annotations such as:
@Policies({ @Policy(uri = "annotationpolicies/TestOperationPolicy.xml"), @Policy(uri = "annotationpolicies/TestOperationInputPolicy.xml", placement = Policy.Placement.BINDING_OPERATION_INPUT), @Policy(uri = "annotationpolicies/TestOperationOutputPolicy.xml", placement = Policy.Placement.BINDING_OPERATION_OUTPUT), @Policy(uri = "annotationpolicies/TestOperationPTPolicy.xml", placement = Policy.Placement.PORT_TYPE_OPERATION), @Policy(uri = "annotationpolicies/TestOperationPTInputPolicy.xml", placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT), @Policy(uri = "annotationpolicies/TestOperationPTOutputPolicy.xml", placement = Policy.Placement.PORT_TYPE_OPERATION_OUTPUT) })
The resulting WSDL ends up generating multiple PolicyReference elements when there is no separate Java Interface for example:
<wsdl:operation name="echoInt"> <soap:operation soapAction="" style="document"/> <wsp:PolicyReference URI="#echoIntBindingOpPolicy"/> <wsp:PolicyReference URI="#echoIntBindingOpPolicy"/> <wsdl:input name="echoInt"> <soap:body use="literal"/> <wsp:PolicyReference URI="#echoIntBindingOpInputPolicy"/> <wsp:PolicyReference URI="#echoIntBindingOpInputPolicy"/> </wsdl:input> <wsdl:output name="echoIntResponse"> <soap:body use="literal"/> <wsp:PolicyReference URI="#echoIntBindingOpOutputPolicy"/> <wsp:PolicyReference URI="#echoIntBindingOpOutputPolicy"/> </wsdl:output> </wsdl:operation>
This problem can be reproduced by modifying the
rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java test so that it counts the number PolicyReference's
This problem affects both the 2.7.x series and master/trunk at the present time, 2.6.x does not have this problem.
A patch for the test mentioned above is attached.