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

wsdl2java generates incorrect code when same element in request and reply

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.4
    • 2.1.6
    • Tooling
    • None
    • Maven version: 2.0.8
      Java version: 1.5.0_17
      Maven plugin "cxf-codegen-plugin" (version 2.1.4) with goal "wsdl2java".

    • Unknown

    Description

      I am working on a WSDL and related xsd files provided by a third party.

      In this WSDL, the root element of the message matches with the name of the operation.
      So the Web service is recognized as "wrapper" web services style by Cxf (the @SOAPBinding annotation
      is not present so the "wrapper" default is taken)

      I have created a simple wsdl/xsd to reproduce the problem I am facing.
      In fact, the request and the response have both a <xs:element> with the same name ("options" in my sample)
      The problem is that the "options" sub-tree is different in the request and in the response.
      The generated code is as follows:
      (extract)
      public void addOptionRequest(
      @WebParam(mode = WebParam.Mode.INOUT, name = "options", targetNamespace = "http://xml.testvv.com/AddOptionReply_1_0")
      javax.xml.ws.Holder<com.testvv.xml.addoptionreply_1_0.AddOptionReply.Options> options,
      ...

      Where addOptionRequest is my "operation".

      The problem is that the "options" generated is the one from the reply. So I am not able to create my request
      "options" to call my webservice.

      Is this a bug or should I use a special option to have the webservices recognized as "non-wrapper"
      (if such an option exist, I haven't found it)
      Is the bug fix in a newer version of Cxf?

      Note: I have tried to rename the operation in the wsdl (in order to have a different operation name than
      the root element of the schema) and in this case, the following annotation appears @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      and everything goes well.

      The problem is that as the WSDL/XSD are provided by a third party, I should not change them.

      Any help would be great

      Valerie

      Attachments

        1. wsdlToBePosted.zip
          3 kB
          Valerie Vanler

        Activity

          People

            Unassigned Unassigned
            vvvanlerb Valerie Vanler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: