Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5665

Java First WS-Policy duplicate PolicyReferences when using annotations and no separate Java Interface

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-milestone2, 2.7.10
    • Fix Version/s: 2.7.11, 3.0
    • Component/s: JAX-WS Runtime
    • Labels:
      None
    • Estimated Complexity:
      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.

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              japearson Joel Pearson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: