Hello,
The Tutorial 7 shows how to use the QuickCarRental EJB-application with webdynpro. The webdynpro model is a webservice model.
The QuickCarRentalException - in case of an error thrown by a SessionBean - will be caught inside the WebDynpro-Controller the following way:
<i> //@@begin onActionRentCar(ServerEvent)
try {
wdContext.currentSaveBookingElement().modelObject().execute();
wdContext.nodeResponse().invalidate();
MessageManager msgMgr=
(MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr.reportSuccess("Success!");
}
catch(Exception ex) {
System.out.println(ex);
ex.printStackTrace();
MessageManager msgMgr =
(MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr.reportException(ex.getLocalizedMessage(), true);
}
//@@end</i>
<b>The Probelm is:</b>
The Exception has lost its state information (message, stacktrace, cause). The information shown in the statusbar is therefore a nullstring. Logging the exception using <i>toString</i> only shows the package+classname.
<b>Conclusion:</b> This Exception-Handling is not sufficient.
<b>Question:</b> How to handle Server Side Exceptions right? Is there a SAP defined way (SOAPFaultExceptions, ..) which can be used to transport the error information from server to client?
Greetings
Ulf Helmke
Message was edited by: Ulf Helmke
Add a comment