Details
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>