Actually, I also faced a similar problem while throwing a RemoteException from POJO. Couldn't get a solution for that. Does anybody have a guide for exception handling or the best practices for this?
-Sandeep ________________________________ From: Li Ma [mailto:lim...@gmail.com] Sent: Monday, February 15, 2010 7:34 PM To: axis-user@ws.apache.org Subject: Please help on Axis2 Exception handling Dear All, I ran into a very weird problem with Axis2 exception handling, which puzzled me for long time. Any help from you Axis2 expert will be greately appreciated! This is what I did: 1. Get my service POJO ready. All method throws a customized MyException which is derived from java.lang.Exception 2. Use Axis2 java2wsdl to convert this POJO to WSDL,. I can see the wsdl:fault part of each service call has been created successfully with name as MyException 3. Then use wsdl2java to generate client side API with ADB binding. Suddenly Axis2 creates a bunch of exception related classes, such as: MyExceptionException MyExceptionE xsd/MyException The methods will throw MyExceptionException, which contains MyExceptionE, which contains xsd/MyException. The xsd/MyException has all properties I defined at server side. Method also throw AxisFault. When I run the client code and throw MyException on server, at client side, I could only catch AxisFault exception which reason string as return of MyException.getMessage() defined on server. I could never catch MyException nor MyExceptionException at client side. This is the bigest issue that troubled me. If Axis2 has to wrap everything in AxisFault at client side, fine, but whey wsdl2java still throws MyExceptionException in generated code and never throw it? Thanks a lot! Li DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.