You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/08/31 00:32:08 UTC
wsdl2java and faults
The objects generated by wsdl2java for faults seem unnecessarily clumsy.
I get a POJO + annotations that corresponds to the fault type. Call it
'X'.
Then I get XFault.
To construct an XFault over a Throwable, I need to provide a message ---
(String message, X x, Throwable cause)
Could there not be no-message constructor? All the information I want to
transmit is inside the x object.
RE: wsdl2java and faults
Posted by Benson Margulies <bi...@basistech.com>.
I was feeling somewhat overwhelmed by three copies of the same string.
My fault object was designed to carry the contents of a java exception,
and then I have to come up with that string, and then I pass the
throwable and get the contents again.
I think we should just write this up to my being cranky at 11pm.
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, August 31, 2007 12:13 PM
> To: cxf-user@incubator.apache.org
> Cc: Benson Margulies
> Subject: Re: wsdl2java and faults
>
>
> Benson,
>
> The "message" parameter is used to set the "faultString" element in
the
> on the wire fault. It should be set to something useful. That
said,
> I THINK we could add a constructor that doesn't have it, you would
just
> get some default behavior in the faultString. (whatever the default
> Exception.getMessage() returns, I think the class name?)
>
> Feel free to log a bug request. (and a patch would be nice too ;-)
>
> Dan
>
> On Thursday 30 August 2007, Benson Margulies wrote:
> > I was hoping for one more constructor on the exception object
> >
> >
> > FaultException(FaultObject, Throwable);
> >
> > If that's not consistent with the standard, then I won't waste
> > everyone's time with a JIRA. It would never be something important.
> >
> > > -----Original Message-----
> > > From: James Mao [mailto:james.mao@iona.com]
> > > Sent: Thursday, August 30, 2007 10:43 PM
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: wsdl2java and faults
> > >
> > > Hi,
> > >
> > > The artifacts generated by wsdl2java is JAX-WS 2.0 compliant, so
> > > everything generated by the tool is defined in the spec.
> > > Not really know the exact request here.
> > > Do you mind send your sample wsdl, and tell us what kind of
> > > artifacts you're looking for
> > >
> > > If there's bug to fix or improvements we can make, you are
welcomed
> > > to file jira on https://issues.apache.org/jira/browse/CXF
> > >
> > > Regards,
> > > James
> > >
> > > > The objects generated by wsdl2java for faults seem unnecessarily
> >
> > clumsy.
> >
> > > > I get a POJO + annotations that corresponds to the fault type.
> > > > Call
> >
> > it
> >
> > > > 'X'.
> > > >
> > > >
> > > >
> > > > Then I get XFault.
> > > >
> > > >
> > > >
> > > > To construct an XFault over a Throwable, I need to provide a
> > > > message
> >
> > ---
> >
> > > > (String message, X x, Throwable cause)
> > > >
> > > >
> > > >
> > > > Could there not be no-message constructor? All the information I
> >
> > want to
> >
> > > > transmit is inside the x object.
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727 C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
Re: wsdl2java and faults
Posted by Daniel Kulp <dk...@apache.org>.
Benson,
The "message" parameter is used to set the "faultString" element in the
on the wire fault. It should be set to something useful. That said,
I THINK we could add a constructor that doesn't have it, you would just
get some default behavior in the faultString. (whatever the default
Exception.getMessage() returns, I think the class name?)
Feel free to log a bug request. (and a patch would be nice too ;-)
Dan
On Thursday 30 August 2007, Benson Margulies wrote:
> I was hoping for one more constructor on the exception object
>
>
> FaultException(FaultObject, Throwable);
>
> If that's not consistent with the standard, then I won't waste
> everyone's time with a JIRA. It would never be something important.
>
> > -----Original Message-----
> > From: James Mao [mailto:james.mao@iona.com]
> > Sent: Thursday, August 30, 2007 10:43 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: wsdl2java and faults
> >
> > Hi,
> >
> > The artifacts generated by wsdl2java is JAX-WS 2.0 compliant, so
> > everything generated by the tool is defined in the spec.
> > Not really know the exact request here.
> > Do you mind send your sample wsdl, and tell us what kind of
> > artifacts you're looking for
> >
> > If there's bug to fix or improvements we can make, you are welcomed
> > to file jira on https://issues.apache.org/jira/browse/CXF
> >
> > Regards,
> > James
> >
> > > The objects generated by wsdl2java for faults seem unnecessarily
>
> clumsy.
>
> > > I get a POJO + annotations that corresponds to the fault type.
> > > Call
>
> it
>
> > > 'X'.
> > >
> > >
> > >
> > > Then I get XFault.
> > >
> > >
> > >
> > > To construct an XFault over a Throwable, I need to provide a
> > > message
>
> ---
>
> > > (String message, X x, Throwable cause)
> > >
> > >
> > >
> > > Could there not be no-message constructor? All the information I
>
> want to
>
> > > transmit is inside the x object.
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog
RE: wsdl2java and faults
Posted by Benson Margulies <bi...@basistech.com>.
I was hoping for one more constructor on the exception object
FaultException(FaultObject, Throwable);
If that's not consistent with the standard, then I won't waste
everyone's time with a JIRA. It would never be something important.
> -----Original Message-----
> From: James Mao [mailto:james.mao@iona.com]
> Sent: Thursday, August 30, 2007 10:43 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: wsdl2java and faults
>
> Hi,
>
> The artifacts generated by wsdl2java is JAX-WS 2.0 compliant, so
> everything generated by the tool is defined in the spec.
> Not really know the exact request here.
> Do you mind send your sample wsdl, and tell us what kind of artifacts
> you're looking for
>
> If there's bug to fix or improvements we can make, you are welcomed to
> file jira on https://issues.apache.org/jira/browse/CXF
>
> Regards,
> James
>
> > The objects generated by wsdl2java for faults seem unnecessarily
clumsy.
> >
> >
> >
> > I get a POJO + annotations that corresponds to the fault type. Call
it
> > 'X'.
> >
> >
> >
> > Then I get XFault.
> >
> >
> >
> > To construct an XFault over a Throwable, I need to provide a message
---
> >
> >
> >
> > (String message, X x, Throwable cause)
> >
> >
> >
> > Could there not be no-message constructor? All the information I
want to
> > transmit is inside the x object.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
Re: wsdl2java and faults
Posted by James Mao <ja...@iona.com>.
Hi,
The artifacts generated by wsdl2java is JAX-WS 2.0 compliant, so
everything generated by the tool is defined in the spec.
Not really know the exact request here.
Do you mind send your sample wsdl, and tell us what kind of artifacts
you're looking for
If there's bug to fix or improvements we can make, you are welcomed to
file jira on https://issues.apache.org/jira/browse/CXF
Regards,
James
> The objects generated by wsdl2java for faults seem unnecessarily clumsy.
>
>
>
> I get a POJO + annotations that corresponds to the fault type. Call it
> 'X'.
>
>
>
> Then I get XFault.
>
>
>
> To construct an XFault over a Throwable, I need to provide a message ---
>
>
>
> (String message, X x, Throwable cause)
>
>
>
> Could there not be no-message constructor? All the information I want to
> transmit is inside the x object.
>
>
>
>
>
>
>
>
>
>
>
Re: wsdl2java and faults
Posted by Jim Ma <em...@iona.com>.
Hi Benson ,
This class is generated as per Jaxws spec 2.5 .
I think the string message in constructor is useful if there is no
message in X to tell us what the fault is or where throw this fault .
The below is the sample we use the message to indicate where cause this
error :
throw new XFault("XFault raised by server when ....", X);
We also can add a constructor (X x , Throwable cause) for your case .
Can you log an enhancement in CXF jira?
Regards
Jim
Benson Margulies wrote:
> The objects generated by wsdl2java for faults seem unnecessarily clumsy.
>
>
>
> I get a POJO + annotations that corresponds to the fault type. Call it
> 'X'.
>
>
>
> Then I get XFault.
>
>
>
> To construct an XFault over a Throwable, I need to provide a message ---
>
>
>
> (String message, X x, Throwable cause)
>
>
>
> Could there not be no-message constructor? All the information I want to
> transmit is inside the x object.
>
>
>
>
>
>
>
>
>
>
>