[ http://issues.apache.org/jira/browse/AXIS-1890?page=all ]
     
Davanum Srinivas resolved AXIS-1890:
------------------------------------

    Resolution: Fixed

Enabling only the following:
  AxisFault(java.lang.Exception target)
  AxisFault(java.lang.String message, java.lang.Throwable t) 

As this may clash with generated code where the exception has one string 
parameter.
  AxisFault(java.lang.String message)

thanks,
dims

> Support additional constructors in generated fault stubs
> --------------------------------------------------------
>
>          Key: AXIS-1890
>          URL: http://issues.apache.org/jira/browse/AXIS-1890
>      Project: Axis
>         Type: Improvement
>   Components: WSDL processing
>     Versions: 1.2RC3
>     Reporter: Will Lauer
>     Priority: Minor

>
> AxisFault supports the following constructors
>   AxisFault(java.lang.Exception target) 
>   AxisFault(java.lang.String message) 
>   AxisFault(java.lang.String message, java.lang.Throwable t) 
> but the exception classes generated from WSDL for faults (which inherit from 
> AxisFault) don't support these, even though these are useful options to have 
> in server-side code. I have found it useful to be able to do
>     ...
>     catch (SomeException e) {
>         throw new MyException(e);
>     }
> Where MyException is a fault that I have exposed through in the WSDL. When I 
> generate the server side stubs for MyException from the WSDL using WSDL2Java, 
> this code doesn't work and requires hand editting of the stubs to add these 
> constructors.
> I believe the following patch should add these extra constructors.
> *** JavaFaultWriter.java~ Mon Feb 28 22:41:48 2005
> --- JavaFaultWriter.java Fri Mar 18 13:24:32 2005
> ***************
> *** 106,111 ****
> --- 106,123 ----
>           pw.println("    public " + className + "() {");
>           pw.println("    }");
>           pw.println();
> +         pw.println("    public " + className + "(java.lang.Exception 
> target) {");
> +         pw.println("        super(target);");
> +         pw.println("    }");
> +         pw.println();
> +         pw.println("    public " + className + "(java.lang.String message) 
> {");
> +         pw.println("        super(message);");
> +         pw.println("    }");
> +         pw.println();
> +         pw.println("    public " + className + "(java.lang.String message, 
> java.lang.Throwable t) {");
> +         pw.println("        super(message, t);");
> +         pw.println("    }");
> +         pw.println();
>   
>           // contructor that initializes data
>           if (params.size() > 0) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to