Bug 1083770 - [GSS] (6.4.0) Java First WS-Policy duplicate PolicyReferences when using annotations and no separate Java Interface
Summary: [GSS] (6.4.0) Java First WS-Policy duplicate PolicyReferences when using anno...
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Services
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: DR6
: EAP 6.4.0
Assignee: Alessio Soldano
QA Contact: Rostislav Svoboda
Depends On:
Blocks: 1087653 1103627 1103847 1115213 1143935
TreeView+ depends on / blocked
Reported: 2014-04-02 22:46 UTC by Kyle Lape
Modified: 2019-08-02 07:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
A bug exists in CXF this version of JBoss EAP that causes `PolicyReferences` to be duplicated when using Java First WS-Policy Annotations (such as @Policies). The resulting WSDL generates multiple 'PolicyReference' elements when there is no separate Java interface.
Clone Of:
: 1103847 (view as bug list)
Last Closed: 2019-08-02 07:27:06 UTC
Type: Bug

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Apache JIRA CXF-5665 None None None Never
Apache JIRA CXF-5841 None None None Never

Description Kyle Lape 2014-04-02 22:46:03 UTC
[Copied problem description from CXF Jira]

In CXF 2.7.10 when using Java First WS-Policy Annotations such as:
	@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:output name="echoIntResponse">
				<soap:body use="literal"/>
				<wsp:PolicyReference URI="#echoIntBindingOpOutputPolicy"/>
				<wsp:PolicyReference URI="#echoIntBindingOpOutputPolicy"/>

Comment 1 Scott Mumford 2014-04-23 01:43:21 UTC
Flagged as Known Issue as ticket unresolved at the time of writing the release note.

Comment 2 Nichola Moore 2014-05-14 02:00:56 UTC
Now set to bug fix as requested in bug 1096876. 
A resolution needs to be added to the doc text, however.

Comment 3 Nichola Moore 2014-05-14 04:57:11 UTC
Set back to known issue. Flag reset in error.

Comment 4 Kyle Lape 2014-05-30 16:35:23 UTC
This should already be included in 6.3.0 since this fix was included in CXF 2.7.11:

klape@localhost cxf$ git tag --contains eb5ac69120bc7799997740ff6817864039b55518

Comment 6 Jan Blizňák 2014-07-02 15:20:47 UTC
I still see reported issue in 6.3.0.ER8:

Defining webservice with no interface like this:

      serviceName = "HelloWorldServiceNoInterface",
      portName = "HelloWorld1", 
      name = "HelloWorld1", 
      targetNamespace = "http://www.jboss.org/jbossas/quickstarts/wshelloworld/HelloWorld1"
@Policy(uri = "ws-policy/x509SecurityPolicy.xml", placement = Policy.Placement.BINDING)
public class HelloWorldServiceNoInterface {

        @Policy(uri = "ws-policy/inputPolicy.xml", placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT),
        @Policy(uri = "ws-policy/outputPolicy.xml", placement = Policy.Placement.PORT_TYPE_OPERATION_OUTPUT)
    public String sayHello() {
        return "Hello World!";

still results in multiple PolicyReference elements in wsdl:

<wsdl:portType name="HelloWorld1">
  <wsdl:operation name="sayHello">
    <wsdl:input message="tns:sayHello" name="sayHello">
      <wsp:PolicyReference URI="#Input_Security_Policy"/>
      <wsp:PolicyReference URI="#Input_Security_Policy"/>
    <wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse">
      <wsp:PolicyReference URI="#Output_Security_Policy"/>
      <wsp:PolicyReference URI="#Output_Security_Policy"/>
<wsdl:binding name="HelloWorldServiceNoInterfaceSoapBinding" type="tns:HelloWorld1">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsp:PolicyReference URI="#X509SecurityPolicy"/>
  <wsp:PolicyReference URI="#X509SecurityPolicy"/>
  <wsdl:operation name="sayHello">
    <soap:operation soapAction="" style="document"/>
    <wsdl:input name="sayHello">
      <soap:body use="literal"/>
    <wsdl:output name="sayHelloResponse">
    <soap:body use="literal"/>

Comment 7 Kyle Lape 2014-07-03 19:50:13 UTC
This should not block 6.3.0 release.  It can be pushed to 6.3.1 if needed.

Comment 8 baranowb 2014-07-08 10:37:12 UTC
Shifting to 6.4.0.

Comment 10 Jan Blizňák 2014-11-04 17:07:17 UTC
Verified with 6.4.0.DR8

Note You need to log in before you can comment on or make changes to this bug.