Hi Alan, There's some discussion of the Axis2 Fault handling at http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/faults, which it sounds like you've already read. This doesn't go into the full details, though. Basically, Axis2 requires that (1) each exception being thrown has a unique data object associated with the exception, and (2) each exception extends AxisFault. The reasons for these requirements are buried in the Axis2 implementation - basically the first is so that the client code can use data binding to convert a Fault message to an object, and then determine the type of exception to be thrown based on the object type, while the second is an API convenience. I consider this strange form of exception/fault handling - particularly the part about having a unique data object - a flaw in the Axis2 design.
Jibx2Wsdl tries to cope with this requirement as best it can. Depending on the version of Axis2 you're using, the actual exception name that comes out of WSDL2Java on the other end may differ significantly from the exception you started with, but is usually recognizable. It'll always be a different class, though. Hope that helps, - Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Lee, Alan wrote: > > Hi All, > > I have a web service method with a signature of: > > *public* *void* throwException() *throws* CustomException; > > However, after I ran jibx2wsdl and then wsdl2java, the generated > client code becomes: > > *public* *void* throwException() *throws* CustomFault { > > } > > From my understanding after reading the example from the jibx2wsdl > website, we are supposed to construct the CustomerFault with the > CustomException in the ServiceImpl class. > > */Is that right?/* > > Then my next question is in Axis1, we do not have to do this extra > step. (i.e. the client interface will be the same as the server’s; > namely: *public* *void* throwException() *throws* CustomException) > > Could anyone tell me why the extra step was introduced with > Axis2-JiBX? What’re the benefits? > > Thanks in advance! > > Alan Lee > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ jibx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-users
