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

wsdl2java fails to generate consistent Java from equivilent valid but slightly different WSDL, e.g. soap_header example

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 2.1.10, 2.0.13, 2.3, 2.2.12, 2.4, 2.4.1
    • Invalid
    • Tooling
    • JDK 1.6_u20

    • Moderate

    Description

      Using the CXF distributed sample soap_header, by a small valid modification simplifying the wsdl, the generated code is altered significantly, with the parameters for the SOAP Body parameter being dropped.

      Sample from the unmodified CXF sample wsdl:

          @WebResult(name = "outHeaderResponse", targetNamespace = "http://apache.org/cxf/sample/headers/body/", partName = "the_response")
          @WebMethod
          public org.apache.cxf.sample.headers.body.OutHeaderResponse outHeader(
              @WebParam(partName = "me", name = "outHeader", targetNamespace = "http://apache.org/cxf/sample/headers/body/")
              org.apache.cxf.sample.headers.body.OutHeader me,
              @WebParam(partName = "header_info", mode = WebParam.Mode.INOUT, name = "SOAPHeaderInfo", targetNamespace = "http://apache.org/cxf/sample/headers/header/", header = true)
              javax.xml.ws.Holder<org.apache.cxf.sample.headers.header.SOAPHeaderData> headerInfo
          );
      

      Sample output from modified wsdl processing:

          @WebResult(name = "responseType", targetNamespace = "")
          @RequestWrapper(localName = "outHeader", targetNamespace = "http://apache.org/cxf/sample/headers/body/", className = "org.apache.cxf.sample.headers.body.OutHeader")
          @WebMethod
          @ResponseWrapper(localName = "outHeaderResponse", targetNamespace = "http://apache.org/cxf/sample/headers/body/", className = "org.apache.cxf.sample.headers.body.OutHeaderResponse")
          public java.lang.String outHeader(
              @WebParam(name = "requestType", targetNamespace = "")
              java.lang.String requestType
          );
      

      Note the missing header parameter in the modified wsdl vs unmodified wsdl:

              @WebParam(partName = "header_info", mode = WebParam.Mode.INOUT, name = "SOAPHeaderInfo", targetNamespace = "http://apache.org/cxf/sample/headers/header/", header = true)
              javax.xml.ws.Holder<org.apache.cxf.sample.headers.header.SOAPHeaderData> headerInfo
      

      Here is an example call from the original sample wsdl:

      <!-- the message def -->
          <message name="inHeaderRequest">
              <part element="tns:inHeader" name="me"/>
              <part element="tns:SOAPHeaderInfo" name="header_info"/>
          </message>
          <message name="inHeaderResponse">
              <part element="tns:inHeaderResponse" name="the_response"/>
          </message>
      
      <!-- the related operation in the binding -->
      
              <operation name="inHeader">
                  <soap:operation soapAction="" style="document"/>
                  <input name="inHeaderRequest">
                      <soap:body parts="me" use="literal"/>
                      <soap:header message="tns:inHeaderRequest" part="header_info" 
                          use="literal"/>
                  </input>
                  <output name="inHeaderResponse">
                      <soap:body use="literal"/>
                  </output>
              </operation>
      

      And the modified wsdl that is not apparently parsed correctly:

      <!-- the message def -->
          <message name="HeaderInfo">
              <part element="tns:SOAPHeaderInfo" name="header_info"/>
          </message>    
          <message name="inHeaderRequest">
              <part element="tns:inHeader" name="me"/>
          </message>
          <message name="inHeaderResponse">
              <part element="tns:inHeaderResponse" name="the_response"/>
          </message>
      
      <!-- the related operation in the binding -->
      
              <operation name="inHeader">
                  <soap:operation soapAction="" style="document"/>
                  <input name="inHeaderRequest">
                      <soap:body parts="me" use="literal"/>
                      <soap:header message="tns:HeaderInfo" part="header_info" 
                          use="literal"/>
                  </input>
                  <output name="inHeaderResponse">
                      <soap:body use="literal"/>
                  </output>
              </operation>
      

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            technosf Martin
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: