il get confirmation from a dev then jira it i guess - mostly going to be php clients in my case so i havent resorted to a work around yet.
/tom -----Original Message----- From: Silvano Maffeis [mailto:[EMAIL PROTECTED] Sent: Monday, October 11, 2004 10:21 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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