You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Thomas Bailey <th...@gamefederation.com> on 2004/10/11 10:28:16 UTC
RE: wsdl2java fault bug ?
Hi All,
Can any of the devs confirm this is a case for jira ?
/tom
-----Original Message-----
From: Silvano Maffeis [mailto:silvano@pyx.ch]
Sent: Monday, October 11, 2004 10:21 AM
To: axis-user@ws.apache.org
Cc: thomas.bailey@gamefederation.com
Subject: Re: wsdl2java fault bug ?
Yes, I just got that very same problem! I'm using axis-1_2RC1.
Any workarounds? (Well, besides resorting to using just one fault type,
of course 8-)
silvano
thomas.bailey@gamefederation.com wrote:
>Anyone else observed that when you have code that throws multiple possible
>faults, the generated stub assumes that the fault is always the last
>defined ?
>
>in this case, if you throw SomeOtherFault and verify that the XML going
>over the wire correctly reflects the fault, client side it assumes the
>fault relates to NoSuchUserFault and inturn complains about missing
>faultcode (since its set for SomeOtherFault and not NoSuchUserFault since
>we didnt want to throw that) ?
>
>i.e
>
>oper.addFault(new org.apache.axis.description.FaultDesc(
>new javax.xml.namespace.QName("urn:userservice", "fault"),
>"com.mypackage.faults.SomeOtherFault",
>new javax.xml.namespace.QName("http://faults.mypackage.com",
>"ServerFault"), true));
>
>oper.addFault(new org.apache.axis.description.FaultDesc(
>new javax.xml.namespace.QName("urn:userservice", "fault"),
>"com.mypackage.faults.NoSuchUserFault",
>new javax.xml.namespace.QName("http://faults.mypackage.com",
>"NoSuchUserFault"), true));
>
>try
>{
> // do stuff that might generate these exceptions
>}
>catch(NoSuchUserException nsue)
>{
> throw new com.mypackage.faults.NoSuchUserFault(nsue.getUsername());
>}
>catch(SomeOtherException soe)
>{
> throw new com.mypackage.faults.SomeOtherFault(soe.getUsername());
>}
>
>/tom
>
>
--
Dr. Silvano Maffeis, Software Architect, Pyx Engineering AG Zurich
http://www.maffeis.com http://www.pyx.ch phone:+41-1-404-1006