axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Bailey" <thomas.bai...@gamefederation.com>
Subject RE: wsdl2java fault bug ?
Date Mon, 11 Oct 2004 08:28:16 GMT
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


Mime
View raw message