Hi!
When creating a web service using existing business logic with "code first" 
approach I dont think custom exceptions are handled the way it should. (Axis2 
1.3)The custom exception appears on the client side in the AxisFault details 
field within <exception><exception> -tags together with a HUGE stack trace.
 
I have checked the source code for RPCMesssageReceiver and specially the 
section that handles the AxisFault:
} catch (InvocationTargetException e) {            String msg = null;           
 Throwable cause = e.getCause();            if (cause != null) {                
msg = cause.getMessage();            }            if (msg == null) {            
    msg = "Exception occurred while trying to invoke service method " +         
               method.getName();            }            if (cause instanceof 
AxisFault) {                log.debug(msg, cause);                throw 
(AxisFault)cause;            }            log.error(msg, e);            throw 
new AxisFault(msg, e);        } catch(RuntimeException e) {            throw 
AxisFault.makeFault(e);        } catch (Exception e) {            String msg = 
"Exception occurred while trying to invoke service method " +                   
 method.getName();            log.error(msg, e);            throw 
AxisFault.makeFault(e);        }}
Could it be possible to change this code a little bit to throw an AxisFault 
with a CustomException only in the details field? 
Like: The AxisFault.getDetails() returns something like <CustomException>custom 
message... </CustomException>
It would be much easier to handle the exception on the client side!
What do you gurus think?
 
/Pär
 
 
 
 
 
 
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

Reply via email to