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>
Anecdotal evidence suggests that CXF 2.6.x doesn't have this problem,
because JBoss EAP 6.1.0 doesn't have this problem (based on 2.6.6), but
JBoss EAP 6.2.0 does (based on 2.7.7)
I have found that
org.apache.cxf.jaxws.ws.PolicyAnnotationTest.testAnnotationsInterfaceAsClass()
actually shows this problem if you enable the
"org.apache.cxf.helpers.XMLUtils.printDOM(wsdl);" line, you can see it in
the output. The test could probably be extended to found the number of
PolicyReference elements output easily enough.
--
View this message in context:
http://cxf.547215.n5.nabble.com/Java-First-WS-Policy-duplicate-PolicyReferences-when-using-annotations-and-no-separate-Java-Interface-tp5742132.html
Sent from the cxf-user mailing list archive at Nabble.com.