[jira] [Commented] (CXF-8114) cxf-codegen-plugin generates invalid code for operations with empty parameters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (CXF-8114) cxf-codegen-plugin generates invalid code for operations with empty parameters

Colm O hEigeartaigh (Jira)

    [ https://issues.apache.org/jira/browse/CXF-8114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16945142#comment-16945142 ]

Dennis Kieselhorst commented on CXF-8114:
-----------------------------------------

I suppose you don't own the service you are trying to call? If you changed the wsdl and remove the message part, it would work.
{code:java}
<wsdl:message name="createRetoureIdRequest">
</wsdl:message>
{code}
instead of
{code:java}
<wsdl:message name="createRetoureIdRequest">
  <wsdl:part element="tns:CreateRetoureIdRequest" name="createRetoureIdRequest">
  </wsdl:part>
</wsdl:message>
{code}
Another option is described here [https://stackoverflow.com/questions/6134348/wsdl-type-for-getter-without-parameter]. I think It's more a JAX-WS/ JAXB issue than something specific to CXF.

> cxf-codegen-plugin generates invalid code for operations with empty parameters
> ------------------------------------------------------------------------------
>
>                 Key: CXF-8114
>                 URL: https://issues.apache.org/jira/browse/CXF-8114
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.3.3
>            Reporter: Stephan Wienczny
>            Priority: Major
>         Attachments: OneClickForRefund.wsdl
>
>
> We are trying to implement a webservice from a given wsdl. It contains an operation (createRetoureId) that references an empty element (CreateRetoureIdRequest)
> as parameter, e.g. it is an operation without an actual parameter. In the generated code this parameter is mapped to "java.lang.Object":
> {{}}{{@WebMethod}}
> {{@WebResult(name = "CreateRetoureIdResponse", targetNamespace = "http://oneclickforrefund.dpag.de", partName = "parameters")}}
> {{@Generated(value = "org.apache.cxf.tools.wsdlto.WSDLToJava", date = "2019-09-13T11:24:07.696+02:00")}}
> {{public CreateRetoureIdResponse createRetoureId(}}
> {{ @WebParam(partName = "createRetoureIdRequest", name = "CreateRetoureIdRequest", targetNamespace = "http://oneclickforrefund.dpag.de")}}
> {{ java.lang.Object createRetoureIdRequest}}
> {{) throws CreateRetoureIdException_Exception;}}
>  
> I did not find a way to pass a valid value to the method when being invoked from Java. Neither "null" nor "new Object()" result in a message being send.
>  
> The wsdl is attached and publicly available at [https://internetmarke.deutschepost.de/OneClickForRefund?wsdl
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)