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

CXF 3.5.0 Generated WSDL root element

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.5.3, 3.4.8, 4.0.0
    • None
    • None
    • Unknown

    Description

      Hi,

      I'm migrating an existing soap service from 3.1.5 version to 3.5.0.

      The wsdl contains the following information :

       

      <xsd:element name="getMobileProductsRequest">                 
        <xsd:complexType>                     
          <xsd:sequence>                         
            <xsd:element name="channel" type="tns:channelEnum" minOccurs="1"/>
            ...  
          </xsd:sequence>                 
        </xsd:complexType>             
      </xsd:element>
      ...
      <wsdl:message name="getMobileProductsRequest">         
        <wsdl:part name="getMobileProductsRequest" element="nsmp:getMobileProductsRequest"/>     
      </wsdl:message>
      ...
      <wsdl:binding name="ptMobileCatalogSoapBinding" type="tns:ptMobileCatalog">
       ...
      <wsdl:operation name="getMobileProducts">             
        <wsdl:input message="tns:getMobileProductsRequest" name="getMobileProductsRequest">   </wsdl:input>             
        <wsdl:output message="tns:getMobileProductsResponse" name="getMobileProductsResponse">
        </wsdl:output>             
        <wsdl:fault message="tns:MsgFault" name="MsgFault"></wsdl:fault>       </wsdl:operation>
       ...
      </wsdl:binding>
      

      When I look the generated wsdl, cxf add a root element getMobileProducts above getMobileProductsRequest :

       

      <xsd:complexType name="getMobileProducts">
         <xsd:sequence>
            <xsd:element minOccurs="0" ref="ns0:getMobileProductsRequest"/>
         </xsd:sequence>
      </xsd:complexType>
      
      <wsdl:message name="getMobileProducts">
          <wsdl:part element="tns:getMobileProducts" name="parameters"> </wsdl:part>
      </wsdl:message> 
      
      <wsdl:binding name="PtMobileCatalogSoapBinding" type="tns:PtMobileCatalogPortType">
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="getMobileProducts">
              <soap:operation soapAction="" style="document"/>
              <wsdl:input name="getMobileProducts">
                  <soap:body use="literal"/>
              </wsdl:input>
              <wsdl:output name="getMobileProductsResponse">
                  <soap:body use="literal"/>
              </wsdl:output>
              <wsdl:fault name="MsgFault">
                  <soap:fault name="MsgFault" use="literal"/>
              </wsdl:fault>
          </wsdl:operation>
      </wsdl:binding>

      Do you know how can we fix it because we have another backend that call our webservice and we cannot change the original wsdl?

       

      Thank you for your help

       

       

       

       

      Attachments

        1. mobileCatalog.wsdl
          3 kB
          Vincent
        2. mobileCatalog.xsd
          1 kB
          Vincent

        Activity

          reta Andriy Redko added a comment -

          Hi vincent.broucke , do you happen to use `@RequestWrapper` annotation? Could you please share the small (relevant) snippet of the service your generate WSDL for? Thank you.

          reta Andriy Redko added a comment - Hi vincent.broucke , do you happen to use `@RequestWrapper` annotation? Could you please share the small (relevant) snippet of the service your generate WSDL for? Thank you.

          Hi, Andriy, I generated my classes from WSDL using apache cxf-codegen-plugin and here is the small snippet of my service :

           

          @WebService(targetNamespace = "http://mobilecatalog.esb.voo.be", name = "ptMobileCatalog")
          @XmlSeeAlso({ObjectFactory.class})
          @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
          public interface PtMobileCatalog {
              ....
              @WebMethod(action = "getMobileProducts")
              @WebResult(name = "getMobileProductsResponse", targetNamespace = "http://mobilecatalog.esb.voo.be", partName = "getMobileProductsResponse")
              public GetMobileProductsResponse getMobileProducts(        @WebParam(partName = "getMobileProductsRequest", name = "getMobileProductsRequest", targetNamespace = "http://mobilecatalog.esb.voo.be")
                  GetMobileProductsRequest getMobileProductsRequest
              ) throws MsgFault;
              ...
          } 

          Thank you for your help

          v.broucke Vincent Broucke added a comment - Hi, Andriy, I generated my classes from WSDL using apache cxf-codegen-plugin and here is the small snippet of my service :   @WebService(targetNamespace = "http: //mobilecatalog.esb.voo.be" , name = "ptMobileCatalog" ) @XmlSeeAlso({ObjectFactory.class}) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public interface PtMobileCatalog { ....     @WebMethod(action = "getMobileProducts" )     @WebResult(name = "getMobileProductsResponse" , targetNamespace = "http: //mobilecatalog.esb.voo.be" , partName = "getMobileProductsResponse" )     public GetMobileProductsResponse getMobileProducts(        @WebParam(partName = "getMobileProductsRequest" , name = "getMobileProductsRequest" , targetNamespace = "http: //mobilecatalog.esb.voo.be" )         GetMobileProductsRequest getMobileProductsRequest     ) throws MsgFault; ... } Thank you for your help
          reta Andriy Redko added a comment - - edited

          Thanks vincent.broucke , with the information I have I was not able to reproduce the issue, I don't see this type: <xsd:complexType name="getMobileProducts">

          May I ask you please to share the minimal reproducer project?
          Thank you. 

          reta Andriy Redko added a comment - - edited Thanks vincent.broucke , with the information I have I was not able to reproduce the issue, I don't see this type: <xsd:complexType name="getMobileProducts"> May I ask you please to share the minimal reproducer project? Thank you. 
          vincent.broucke Vincent added a comment -

          Hi,

          I attached the wsdl and the external xsd.

           

          Thank you for your help

          vincent.broucke Vincent added a comment - Hi, I attached the wsdl and the external xsd.   Thank you for your help
          vincent.broucke Vincent added a comment - - edited

          I finally found the solution! It's because of the presence of two versions of jakarta.jws/jakarta.jws-api in my Karaf.

           

          I don't know why, but org.apache.cxf:cxf-bundle-compatible:jar:3.5.0 has a dependency to jakarta.jws/jakarta.jws-api/2.1.0 and in the [cxf-feature 3.5.0|https://github.com/apache/cxf/blob/cxf-3.5.0/osgi/karaf/features/src/main/resources/features.xml] the version 1.1.1 is installed?

          vincent.broucke Vincent added a comment - - edited I finally found the solution! It's because of the presence of two versions of jakarta.jws/jakarta.jws-api in my Karaf.   I don't know why, but org.apache.cxf:cxf-bundle-compatible:jar:3.5.0 has a dependency to jakarta.jws/jakarta.jws-api/2.1.0 and in the [cxf-feature 3.5.0| https://github.com/apache/cxf/blob/cxf-3.5.0/osgi/karaf/features/src/main/resources/features.xml ] the version 1.1.1 is installed?
          reta Andriy Redko added a comment -

          Thanks for figuring it out vincent.broucke, this is definitely a bug, should be fixed by https://github.com/apache/cxf/pull/941

          reta Andriy Redko added a comment - Thanks for figuring it out vincent.broucke , this is definitely a bug, should be fixed by https://github.com/apache/cxf/pull/941
          reta Andriy Redko added a comment - Closed by https://github.com/apache/cxf/pull/941

          People

            reta Andriy Redko
            vincent.broucke Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: