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

Daniel Kulp commented on CXF-5545:
----------------------------------

To follow up my comment, there is no point in generating that fault.  Without a 
message part that would become the detail, there, the fault would never be 
thrown on the client side.  On the server side, there would not be anything to 
write out for the client to use to determine what the fault was.  You could 
just throw a RuntimeException directly and get the same result.

So the correct bug is to fix the validation to reject this WSDL.

> wsdl2java sholud create java.lang.Exception matching constructors for fault 
> with no fields
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-5545
>                 URL: https://issues.apache.org/jira/browse/CXF-5545
>             Project: CXF
>          Issue Type: Improvement
>          Components: Tooling
>    Affects Versions: 3.0.0-milestone1
>            Reporter: Kamil Wiśniewski
>            Priority: Trivial
>             Fix For: 3.0.0-milestone2
>
>         Attachments: patch.txt
>
>
> wsdl2java when exceptionSuperclass is java.lang.Exception (the default) 
> should create respective constructors of java.lang.Exception in case when 
> fault has no fields.
> *When operation is defined*
>    <wsdl:operation name="QueryAllReasons">
>             <wsdl:input name="QueryAllReasonsRQ" 
> message="rds:ReasonQueryAllRQ"/>
>             <wsdl:output name="QueryAllReasonsRS" 
> message="rds:ReasonQueryAllRS"/>
>             <wsdl:fault name="ServiceFault" 
> message="rds:ReasonDefinitionServiceFault"/>           
>         </wsdl:operation>
> *and message part for fault is empty*
>  <wsdl:message name="ReasonDefinitionServiceFault">       
>     </wsdl:message>
> *generated java class should look like this:*
> package com.sabre.apd.cm.jaxb.plugin;
> import javax.xml.ws.WebFault;
> /**
>  * This class was generated by Apache CXF 3.0.0-milestone1
>  * 2014-02-06T03:28:41.558+01:00
>  * Generated source version: 3.0.0-milestone1
>  */
> public class ReasonDefinitionServiceFault extends Exception {
>     public ReasonDefinitionServiceFault() {
>     }
>     public ReasonDefinitionServiceFault(String message) {
>         super(message);
>     }
>     public ReasonDefinitionServiceFault(String message, Throwable cause) {
>         super(message, cause);
>     }
>     public ReasonDefinitionServiceFault(Throwable cause) {
>         super(cause);
>     }
> }



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to