Hi,

We are using CXF 2.2.5 for a project, and we are trying to upgrade to current 
version (2.2.10).
But it happens that, for many of our services, the Java interface generated by 
wsdl2java does change.
Here is an example:

<wsdl:definitions ...>
  <wsdl:types>
    <xsd:schema ...>
      <xsd:complexType name="Update">
        <xsd:sequence>
          <xsd:element name="installedResource" type="InstalledResource"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="UpdateResponse">
        <xsd:sequence>
          <xsd:element name="installedResource" type="InstalledResource"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="update">
    <wsdl:part name="fault" element="schemas:update"/>
  </wsdl:message>
  <wsdl:message name="updateResponse">
    <wsdl:part name="fault" element="schemas:updateResponse"/>
  </wsdl:message>
  <wsdl:portType name="ManageResourceInstalledBase">
    <wsdl:operation name="update">
      <wsdl:input name="updateInput" message="interface:update"/>
      <wsdl:output name="updateOutput" message="interface:updateResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding ...>
    ...
  </wsdl:binding>
  <wsdl:service ...>
    ...
  </wsdl:service>
</wsdl:definitions>

CXF 2.2.5 used to generate the following interface method for this operation:

    @ResponseWrapper(localName = "updateResponse", targetNamespace = "...", 
className = "....UpdateResponse")
    @RequestWrapper(localName = "update", targetNamespace = "...", className = 
"....Update")
    @WebResult(name = "installedResource", targetNamespace = "...")
    @WebMethod(action = "...")
    public InstalledResource update(
          @WebParam(name = "installedResource", targetNamespace = "...")
          InstalledResource installedResource
    );

CXF 2.2.10 now generates the following interface method instead:

    @ResponseWrapper(localName = "updateResponse", targetNamespace = "...", 
className = "....UpdateResponse")
    @RequestWrapper(localName = "update", targetNamespace = "...", className = 
"....Update")
    @WebMethod(action = "...")
    public void update(
        @WebParam(mode = WebParam.Mode.INOUT, name = "installedResource", 
targetNamespace = "...")
        javax.xml.ws.Holder<InstalledResource> installedResource
    );

According to the JAX-WS spec, the later code is the right one: input and output 
parameters both have a single 
child element, with the same name and type, and thus can be wrapped as an 
in/out parameter.
CXF 2.2.5 actualy had a bug, which was fixed with issue CXF-2582:
https://issues.apache.org/jira/browse/CXF-2582

But we have developed our code based on the former kind of interfaces, and we 
would like to keep that unchanged.
Hence the question: is there some way (with jaxws bindings for instance) to 
restore 2.2.5-style interfaces in such cases?
We would like to achieve this without modifying the WSDL, and without disabling 
wrapper style.

Thanks in advance for your help and ideas,
Thomas.

Reply via email to